Updated scripts
Signed-off-by: James Ketrenos <james.p.ketrenos@intel.com>
This commit is contained in:
parent
c28ce2bbe5
commit
c8bcb18200
@ -16,12 +16,12 @@ export $(sed -nE "s,(^[^#][^=]*).*$,\1,pg" MANIFEST | ${CMD} -d '\n')
|
|||||||
|
|
||||||
AGAMA_VERSION=${AGAMA_VERSION:-N/A}
|
AGAMA_VERSION=${AGAMA_VERSION:-N/A}
|
||||||
[[ "${AGAMA_VERSION}" == "N/A" ]] && {
|
[[ "${AGAMA_VERSION}" == "N/A" ]] && {
|
||||||
TAG=${TAG:-build-$(date +%Y%m%d)}
|
TAG=${TAG:-test-build-${PACKAGE_STREAM}-$(date +%Y%m%d)}
|
||||||
} || {
|
} || {
|
||||||
TAG=${TAG:-agama-${AGAMA_VERSION}}
|
TAG=${TAG:-test-agama-${AGAMA_VERSION}}
|
||||||
}
|
}
|
||||||
|
|
||||||
docker build . -t ${CONTAINER}:${TAG} || {
|
docker build -t ${CONTAINER}:${TAG} . $* || {
|
||||||
cat << EOM
|
cat << EOM
|
||||||
|
|
||||||
Building docker image failed.
|
Building docker image failed.
|
||||||
@ -30,14 +30,14 @@ EOM
|
|||||||
exit $?
|
exit $?
|
||||||
}
|
}
|
||||||
|
|
||||||
docker tag ${CONTAINER}:agama-${AGAMA_VERSION} ${CONTAINER}
|
docker tag ${CONTAINER}:${TAG} ${CONTAINER}
|
||||||
rc=$?
|
rc=$?
|
||||||
if [ $rc -ne 0 ]; then
|
if [ $rc -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat << EOM
|
cat << EOM
|
||||||
This image was built and locally tagged as ${CONTAINER}:agama-${AGAMA_VERSION}
|
This image was built and locally tagged as ${CONTAINER}:${TAG}
|
||||||
|
|
||||||
See 'scripts/push-images' for information on pushing this tag to Harbor.
|
See 'scripts/push-images' for information on pushing this tag to Harbor.
|
||||||
|
|
||||||
|
@ -14,32 +14,38 @@ fi
|
|||||||
export $(sed -nE "s,(^[^#][^=]*).*$,\1,pg" SOLUTION | ${CMD} -d '\n')
|
export $(sed -nE "s,(^[^#][^=]*).*$,\1,pg" SOLUTION | ${CMD} -d '\n')
|
||||||
export $(sed -nE "s,(^[^#][^=]*).*$,\1,pg" MANIFEST | ${CMD} -d '\n')
|
export $(sed -nE "s,(^[^#][^=]*).*$,\1,pg" MANIFEST | ${CMD} -d '\n')
|
||||||
|
|
||||||
docker tag ${CONTAINER}:agama-${AGAMA_VERSION} ${REPO_URL}/${CONTAINER}:devel
|
AGAMA_VERSION=${AGAMA_VERSION:-N/A}
|
||||||
docker push ${REPO_URL}/${CONTAINER}:devel
|
[[ "${AGAMA_VERSION}" == "N/A" ]] && {
|
||||||
rc=$?
|
TAG=${TAG:-test-build-${PACKAGE_STREAM}-$(date +%Y%m%d)}
|
||||||
if [ $rc -ne 0 ]; then
|
} || {
|
||||||
exit 1
|
TAG=${TAG:-test-agama-${PACKAGE_STREAM}-${AGAMA_VERSION}}
|
||||||
fi
|
}
|
||||||
|
|
||||||
|
docker tag ${CONTAINER}:${TAG} ${REPO_URL}/${CONTAINER}:${TAG} \
|
||||||
|
&& docker push ${REPO_URL}/${CONTAINER}:${TAG} \
|
||||||
|
|| exit 1
|
||||||
|
|
||||||
cat << EOM
|
cat << EOM
|
||||||
This image was pushed to the devel tag
|
|
||||||
|
|
||||||
amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:devel
|
This image was pushed with the 'test-' tag prefix:
|
||||||
|
|
||||||
If the build looks good, you should commit the changes
|
amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:${TAG/test-}
|
||||||
to Dockerfile and tag it as agama-${AGAMA_VERSION}
|
|
||||||
|
|
||||||
git commit -s -a -m "Build of agama-${AGAMA_VERSION}"
|
If the build looks good, you can promote this build:
|
||||||
git tag -f agama-${AGAMA_VERSION}
|
|
||||||
|
|
||||||
To push to the tag to Harbor:
|
1. Tag the tree it as ${TAG}
|
||||||
|
|
||||||
docker tag ${CONTAINER}:agama-${AGAMA_VERSION} amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:agama-${AGAMA_VERSION}
|
git commit -s -a -m "Build of ${TAG/test-}"
|
||||||
docker push amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:agama-${AGAMA_VERSION}
|
git tag -f ${TAG/test-}
|
||||||
|
|
||||||
If this is a good build, then roll the 'latest' tag to it.
|
2. Remove the 'test-' prefix from the tag:
|
||||||
|
|
||||||
docker tag ${CONTAINER}:agama-${AGAMA_VERSION} amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:latest
|
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}:latest
|
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
|
EOM
|
||||||
|
Loading…
x
Reference in New Issue
Block a user