1
0

Split build-images into build-images and push-images

Modified loading of SOLUTION and MANIFEST so they support nested substitution

Signed-off-by: James Ketrenos <james.p.ketrenos@intel.com>
This commit is contained in:
James Ketrenos 2019-10-14 10:08:34 -07:00
parent b2ae8bc57c
commit c39172c2bf
5 changed files with 76 additions and 37 deletions

View File

@ -1,15 +1,18 @@
#!/bin/bash #!/bin/bash
# Bring in the variables from SOLUTION file
#
# Determine if it is Mac OS and switch to use gxargs instead # Determine if it is Mac OS and switch to use gxargs instead
CMD=xargs CMD=xargs
if [ $(which system_profiler) ]; then if [ $(which system_profiler) ]; then
CMD=gxargs CMD=gxargs
fi fi
export $(grep -v '^#' SOLUTION | ${CMD} -d '\n') # Bring in the variables from SOLUTION file, supporting
export $(grep -v '^#' MANIFEST | ${CMD} -d '\n') # nested substitution
. SOLUTION
. MANIFEST
export $(sed -nE "s,(^[^#][^=]*).*$,\1,pg" SOLUTION | ${CMD} -d '\n')
export $(sed -nE "s,(^[^#][^=]*).*$,\1,pg" MANIFEST | ${CMD} -d '\n')
# Remove the Dockerfile if it exists; should check # Remove the Dockerfile if it exists; should check

View File

@ -1,16 +1,18 @@
#!/bin/bash #!/bin/bash
# Bring in the variables from SOLUTION file
#
# Determine if it is Mac OS and switch to use gxargs instead # Determine if it is Mac OS and switch to use gxargs instead
CMD=xargs CMD=xargs
if [ $(which system_profiler) ]; then if [ $(which system_profiler) ]; then
CMD=gxargs CMD=gxargs
fi fi
export $(grep -v '^#' SOLUTION | ${CMD} -d '\n') # Bring in the variables from SOLUTION file, supporting
export $(grep -v '^#' MANIFEST | ${CMD} -d '\n') # nested substitution
. SOLUTION
. MANIFEST
export $(sed -nE "s,(^[^#][^=]*).*$,\1,pg" SOLUTION | ${CMD} -d '\n')
export $(sed -nE "s,(^[^#][^=]*).*$,\1,pg" MANIFEST | ${CMD} -d '\n')
docker build . -t ${CONTAINER}:agama-${AGAMA_VERSION} || { docker build . -t ${CONTAINER}:agama-${AGAMA_VERSION} || {
cat << EOM cat << EOM
@ -22,32 +24,14 @@ EOM
} }
docker tag ${CONTAINER}:agama-${AGAMA_VERSION} ${CONTAINER} docker tag ${CONTAINER}:agama-${AGAMA_VERSION} ${CONTAINER}
docker tag ${CONTAINER}:agama-${AGAMA_VERSION} ${REPO_URL}/${CONTAINER}:devel
docker push ${REPO_URL}/${CONTAINER}:devel
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 pushed to the devel tag This image was built and locally tagged as ${CONTAINER}:agama-${AGAMA_VERSION}
amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:devel See 'scripts/push-images' for information on pushing this tag to Harbor.
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 EOM

View File

@ -1,14 +1,17 @@
#!/bin/bash #!/bin/bash
# Bring in the variables from SOLUTION file
#
# Determine if it is Mac OS and switch to use gxargs instead # Determine if it is Mac OS and switch to use gxargs instead
CMD=xargs CMD=xargs
if [ $(which system_profiler) ]; then if [ $(which system_profiler) ]; then
CMD=gxargs CMD=gxargs
fi fi
export $(grep -v '^#' SOLUTION | ${CMD} -d '\n') # Bring in the variables from SOLUTION file, supporting
export $(grep -v '^#' MANIFEST | ${CMD} -d '\n') # nested substitution
. SOLUTION
. MANIFEST
export $(sed -nE "s,(^[^#][^=]*).*$,\1,pg" SOLUTION | ${CMD} -d '\n')
export $(sed -nE "s,(^[^#][^=]*).*$,\1,pg" MANIFEST | ${CMD} -d '\n')
docker rmi ${REPO_URL}/${CONTAINER}:devel docker rmi ${REPO_URL}/${CONTAINER}:devel

View File

@ -1,14 +1,18 @@
#!/bin/bash #!/bin/bash
# Bring in the variables from SOLUTION file # Determine if it is Mac OS and switch to use gxargs instead
#
CMD=xargs CMD=xargs
if [ $(which system_profiler) ]; then if [ $(which system_profiler) ]; then
CMD=gxargs CMD=gxargs
fi fi
export $(grep -v '^#' SOLUTION | ${CMD} -d '\n') # Bring in the variables from SOLUTION file, supporting
export $(grep -v '^#' MANIFEST | ${CMD} -d '\n') # nested substitution
. SOLUTION
. MANIFEST
export $(sed -nE "s,(^[^#][^=]*).*$,\1,pg" SOLUTION | ${CMD} -d '\n')
export $(sed -nE "s,(^[^#][^=]*).*$,\1,pg" MANIFEST | ${CMD} -d '\n')
mkdir $(pwd)/media mkdir $(pwd)/media
wget -O $(pwd)/media/AUD_MW_E.264 \ wget -O $(pwd)/media/AUD_MW_E.264 \
@ -20,4 +24,4 @@ docker run \
-e QSV_DEVICE=${QSV_DEVICE:-/dev/dri/renderD128} \ -e QSV_DEVICE=${QSV_DEVICE:-/dev/dri/renderD128} \
--volume $(pwd)/media:/media \ --volume $(pwd)/media:/media \
${REPO_URL}/${CONTAINER}:devel \ ${REPO_URL}/${CONTAINER}:devel \
test test

45
scripts/push-images Executable file
View File

@ -0,0 +1,45 @@
#!/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')
docker tag ${CONTAINER}:agama-${AGAMA_VERSION} ${REPO_URL}/${CONTAINER}:devel
docker push ${REPO_URL}/${CONTAINER}:devel
rc=$?
if [ $rc -ne 0 ]; then
exit 1
fi
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 the tag 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