How can I update cv version to latest version on ccv and publish/promote it using hammer commands?

Latest response

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

Hello, Thank you for the input. However, I still see a manual work there on your process, i.e., you still have to click on ccv and then on "Content Views" and finally choose the latest version from drop-down before you could publish and promote. That's what I need to have automated. I know there is a hammer command something like the following one but I haven't tested it yet.

hammer content-view update --id ${ccv_id} --component-ids "${cv_used_ver_ids}\"

Hi, you may want to look into using something like https://github.com/RedHatSatellite/katello-cvmanager or https://github.com/RedHatSatellite/ballista

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.