#!/bin/bash # Bring in the variables from SOLUTION file # # Determine if it is Mac OS and switch to use gxargs instead CMD=xargs if [ $(which system_profiler) ]; then CMD=gxargs fi export $(grep -v '^#' SOLUTION | ${CMD} -d '\n') export $(grep -v '^#' MANIFEST | ${CMD} -d '\n') docker build . -t ${CONTAINER}:agama-${AGAMA_VERSION} || { cat << EOM Building docker image failed. EOM exit $? } docker tag ${CONTAINER}:agama-${AGAMA_VERSION} ${CONTAINER} docker tag ${CONTAINER}:agama-${AGAMA_VERSION} ${REPO_URL}/${CONTAINER}:devel docker push ${REPO_URL}/${CONTAINER}:devel cat << EOM This image was pushed to the devel tag amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:devel If the build looks good, you should commit the changes to Dockerfile and tag it as agama-${AGAMA_VERSION} git commit -s -a -m "Build of agama-${AGAMA_VERSION}" git tag -f agama-${AGAMA_VERSION} To push to Harbor: docker tag ${CONTAINER}:agama-${AGAMA_VERSION} amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:agama-${AGAMA_VERSION} docker push amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:agama-${AGAMA_VERSION} If this is a good build, then roll the 'latest' tag to it. docker tag ${CONTAINER}:agama-${AGAMA_VERSION} amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:latest docker push amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:latest EOM