Skip to content
Snippets Groups Projects
Unverified Commit 4960960f authored by Vincent Sellier's avatar Vincent Sellier
Browse files

support version suffix on docker image

parent 245f295f
No related branches found
No related tags found
No related merge requests found
...@@ -12,15 +12,19 @@ PUSH=false ...@@ -12,15 +12,19 @@ PUSH=false
function usage() { function usage() {
echo "$0 [-v <version>] [-p] [-h]" echo "$0 [-v <version>] [-p] [-h]"
echo "-v <version> : Specify the version to build default: latest" echo "-v <version> : Specify the version to build default: latest"
echo "-s <suffix> : Specify a suffix to add to the version name <version>_<suffix>"
echo "-p : Push the image to docker hub" echo "-p : Push the image to docker hub"
echo "-h : display this help" echo "-h : display this help"
} }
while getopts "v:ph" opt; do while getopts "v:phs:" opt; do
case $opt in case $opt in
v) v)
VERSION=${OPTARG} VERSION=${OPTARG}
;; ;;
s)
VERSION_SUFFIX=${OPTARG}
;;
p) p)
PUSH=true PUSH=true
;; ;;
...@@ -39,9 +43,14 @@ if [[ "${LOCAL_ARCH}" =~ "arm" ]]; then ...@@ -39,9 +43,14 @@ if [[ "${LOCAL_ARCH}" =~ "arm" ]]; then
fi fi
COMPLETE_IMAGE_NAME="${IMAGE}:${VERSION}-${IMAGE_ARCH}" COMPLETE_IMAGE_NAME="${IMAGE}:${VERSION}-${IMAGE_ARCH}"
if [ -n "${VERSION_SUFFIX:-}" ]; then
COMPLETE_IMAGE_NAME="${COMPLETE_IMAGE_NAME}_${VERSION_SUFFIX}"
fi
pushd "${SCRIPT_DIR}/../cozystack" || exit pushd "${SCRIPT_DIR}/../cozystack" || exit
echo "Preparing easy-cozy image version ${COMPLETE_IMAGE_NAME}"
echo "Refreshing base image..." echo "Refreshing base image..."
docker pull debian:stable-slim docker pull debian:stable-slim
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment