Skip to main content

Posts

Showing posts from January, 2020

Foreman - Automatic content view promotion

This is a common challenge with foreman and I found that a monthly schedule would fit my needs. The promotion will have to go through different environments such as lab + nightly, development, test, production + management. I've added a schema of how this should look like down below. Now keep in mind, that this is the solution that best fits my needs and might not cover all your requirements. However, here's the short script I've created which will be executed by cron daily: #!/usr/bin/env bash ORGANIZATION_LABEL='YOUR_ORGANIZATION' LIFECYCLE_ENVIRONMENT='' DATE_DAY=$(date +%d) WEEK_DAY=$(date +%u) if [[ $DATE_DAY == '01' ]]; then LIFECYCLE_ENVIRONMENT='nightly' for content_view_id in $(hammer content-view list --organization-label $ORGANIZATION_LABEL | egrep -vi 'default' | awk '{print $1}' | egrep '^[1-9]' | egrep -v '14' | awk NF); do hammer content-view publish --id $cont