diff --git a/scripts/build-dockerfile b/scripts/build-dockerfile index 118b5d7..c0a1acc 100755 --- a/scripts/build-dockerfile +++ b/scripts/build-dockerfile @@ -1,15 +1,18 @@ #!/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') +# 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') # Remove the Dockerfile if it exists; should check diff --git a/scripts/build-images b/scripts/build-images index 258a810..6832bbf 100755 --- a/scripts/build-images +++ b/scripts/build-images @@ -1,16 +1,18 @@ #!/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') +# 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 build . -t ${CONTAINER}:agama-${AGAMA_VERSION} || { cat << EOM @@ -22,32 +24,14 @@ EOM } docker tag ${CONTAINER}:agama-${AGAMA_VERSION} ${CONTAINER} -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 +This image was built and locally tagged as ${CONTAINER}:agama-${AGAMA_VERSION} - 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 +See 'scripts/push-images' for information on pushing this tag to Harbor. EOM diff --git a/scripts/clean-image.sh b/scripts/clean-image.sh index 02dc09d..f98b9fe 100755 --- a/scripts/clean-image.sh +++ b/scripts/clean-image.sh @@ -1,14 +1,17 @@ #!/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') +# 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 rmi ${REPO_URL}/${CONTAINER}:devel diff --git a/scripts/devel-test.sh b/scripts/devel-test.sh index fd0feb4..568a71f 100755 --- a/scripts/devel-test.sh +++ b/scripts/devel-test.sh @@ -1,14 +1,18 @@ #!/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') +# 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') mkdir $(pwd)/media wget -O $(pwd)/media/AUD_MW_E.264 \ @@ -20,4 +24,4 @@ docker run \ -e QSV_DEVICE=${QSV_DEVICE:-/dev/dri/renderD128} \ --volume $(pwd)/media:/media \ ${REPO_URL}/${CONTAINER}:devel \ - test \ No newline at end of file + test diff --git a/scripts/push-images b/scripts/push-images new file mode 100755 index 0000000..d527889 --- /dev/null +++ b/scripts/push-images @@ -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