How can I update cv version to latest version on ccv and publish/promote it using hammer commands?
I am trying to find out how can I just update one specific published/promoted content view version under composite content view and publish/promote after that? Also, I am not trying to create a new version of ccv here, just need to update cv version id and publish ccv.
Responses
i am in the process to automate CCV as well so below are steps I was thinking to apply:
Click on the CCV and then select "Content views" tab, in the version column select "Latest" this will make sure the latest published version for that particular CV will be used.
example below: CV-RHEL7-BASE | Latest (Currently 5.0) | Library, dev, test, prod
Get a list of CCV and CV by running hammer:
hammer content-view list
Now you can run hammer to trigger the publication and promotion using either CCV name or Content Views ID. Examples:
#Publish content
hammer content-view publish --organization ORG --name 'CCV-NAME' --description 'latest monthly RPMs' --async
#Promote to dev
#select the latest CCV version
LATEST_VERS=`/bin/hammer content-view version list --content-view "CCV-NAME" --organization ORG |awk '{print $6}'|sort -nr | head -n1`
/bin/hammer content-view version promote --version $LATEST_VERS --organization "ORG" --content-view 'CCV-NAME' --to-lifecycle-environment dev --force --async
Another discussion on the topic available here for more details:
Hope it helps
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
