From 3caec6a48e1338a64abbe95d5232a3eeddd8b792 Mon Sep 17 00:00:00 2001 From: "James P. Ketrenos" Date: Thu, 19 Sep 2019 15:38:59 -0700 Subject: [PATCH] Split build-dockerfile into build-dockerfile and build-images Signed-off-by: James P. Ketrenos --- scripts/build-dockerfile | 16 +++------------- scripts/build-images | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 13 deletions(-) create mode 100755 scripts/build-images diff --git a/scripts/build-dockerfile b/scripts/build-dockerfile index 70eca88..ff87684 100755 --- a/scripts/build-dockerfile +++ b/scripts/build-dockerfile @@ -53,21 +53,11 @@ EOM envsubst < templates/ending.in >> Dockerfile -docker build . -t ${CONTAINER}:agama-${AGAMA_VERSION} - cat << EOM -If the build looks good, you should commit the changes -to Dockerfile and tag it as agama-${AGAMA_VERSION}: +Dockerfile has been updated. - git commit -s -a -m "Build of agama-${AGAMA_VERSION}" - git tag -f agama-${AGAMA_VERSION} +To build the image, you can run scripts/build-images -To push to Harbor: +EOF - docker tag ${CONTAINER}:agama-${AGAMA_VERSION} amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:agama-${AGAMA_VERSION} - 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}:agama-${AGAMA_VERSION} - docker push amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:latest - -EOM diff --git a/scripts/build-images b/scripts/build-images new file mode 100755 index 0000000..8afeba8 --- /dev/null +++ b/scripts/build-images @@ -0,0 +1,33 @@ +#!/bin/bash + +# Bring in the variables from SOLUTION file +# +export $(grep -v '^#' SOLUTION | xargs -d '\n') +export $(grep -v '^#' MANIFEST | xargs -d '\n') + +docker build . -t ${CONTAINER}:agama-${AGAMA_VERSION} + +cat << EOM + +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 build others might want, roll the 'devel' tag to it: + + docker tag ${CONTAINER}:agama-${AGAMA_VERSION} amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:devel + docker push amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:devel + +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