From 409e14b675f31b5fa31446bc5ed6501ab55dc67e Mon Sep 17 00:00:00 2001 From: Lennart Kramer <lennart.kramer@stud.uni-goettingen.de> Date: Fri, 10 Jul 2020 18:14:06 +0200 Subject: [PATCH] Try committing to dockerhub --- .gitlab-ci.yml | 2 +- buildimage.sh | 21 +++++++++------------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 90dc25f..fe25e61 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ stages: variables: GIT_SUBMODULE_STRATEGY: recursive - REGISTRY: "http://registry:5000" + REGISTRY: "mathinstitut" # gitlab ci script taken from https://gist.github.com/danielneis/5c6140ec8150c6151a54bccd26950278 diff --git a/buildimage.sh b/buildimage.sh index 46d7edc..776f574 100755 --- a/buildimage.sh +++ b/buildimage.sh @@ -3,21 +3,14 @@ # arg2: maxima version # arg3: stack or moodle version: "stack-XXX" or "moodlev.X" # arg4: LIB_PATH -# arg5: REGISTRY IP +# arg5: REGISTRY or dockerhub id # arg6: version of goemaxima # echo "starting to build image for:" echo "sbcl: $1" echo "maxima: $2" echo "stack: $3" -# tag the image -if [ -n "$6" ]; then - IMAGENAME="$5/goemaxima-$3:$6" -else - IMAGENAME="$5/goemaxima-$3:dev" -fi -# check if the image already exists on the server -docker pull "${IMAGENAME}" +IMAGENAME="goemaxima:$3" # build it if [ "$3" = "2017121800" ]; then docker build -t "${IMAGENAME}" --build-arg MAXIMA_VERSION="$2" --build-arg SBCL_VERSION="$1" --build-arg LIB_PATH="$4" --build-arg "MAX_LIB_PATH=/opt/maxima/assets/maximalocal.mac" . || exit 1 @@ -25,6 +18,10 @@ else docker build -t "${IMAGENAME}" --build-arg MAXIMA_VERSION="$2" --build-arg SBCL_VERSION="$1" --build-arg LIB_PATH="$4" . || exit 1 fi echo "${IMAGENAME} wurde erfolgreich gebaut." -# push it -docker push "${IMAGENAME}" - +# push the image +docker tag "$IMAGENAME" "$5/$IMAGENAME-dev" +docker push "$5/$IMAGENAME-dev" +if [ -n "$6" ]; then + docker tag "$IMAGENAME" "$5/$IMAGENAME-$6" + docker push "$5/$IMAGENAME-$6" +fi -- GitLab