#!/bin/bash # Determine if it is Mac OS and switch to use gxargs instead CMD=xargs if [ $(which system_profiler) ]; then CMD=gxargs fi # Bring in the variables from SOLUTION file, supporting # nested substitution . SOLUTION . MANIFEST export $(sed -nE "s,(^[^#][^=]*).*$,\1,pg" SOLUTION | ${CMD} -d '\n') export $(sed -nE "s,(^[^#][^=]*).*$,\1,pg" MANIFEST | ${CMD} -d '\n') AGAMA_VERSION=${AGAMA_VERSION:-N/A} [[ "${AGAMA_VERSION}" == "N/A" ]] && { TAG=${TAG:-test-build-${PACKAGE_STREAM}-$(date +%Y%m%d)} } || { TAG=${TAG:-test-agama-${PACKAGE_STREAM}-${AGAMA_VERSION}} } docker tag ${CONTAINER}:${TAG} ${REPO_URL}/${CONTAINER}:${TAG} \ && docker push ${REPO_URL}/${CONTAINER}:${TAG} \ || exit 1 cat << EOM This image was pushed with the 'test-' tag prefix: amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:${TAG/test-} If the build looks good, you can promote this build: 1. Tag the tree it as ${TAG} git commit -s -a -m "Build of ${TAG/test-}" git tag -f ${TAG/test-} 2. Remove the 'test-' prefix from the tag: docker tag ${CONTAINER}:${TAG/test-} amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:${TAG/test-} docker push amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:${TAG/test-} 3. Roll this version to the 'latest': docker tag ${CONTAINER}:${TAG/test-} amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:latest-${PACKAGE_STREAM} docker push amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:latest-${PACKAGE_STREAM} EOM