Commit 453eef44 authored by Alexx Perloff's avatar Alexx Perloff
Browse files

Push the standalone jobs to DockerHub as well. Just one version per release....

Push the standalone jobs to DockerHub as well. Just one version per release. It will be the latest, but not tagged as such, more specific.
parent 0c5b6044
Pipeline #2636824 passed with stage
in 7 seconds
......@@ -59,8 +59,9 @@ check_changes_pipeline:
- echo "Pipeline source - $CI_PIPELINE_SOURCE"
- echo "Building image - $IMAGE_NAME"
- printf "Release - $RELEASE\nScram Arch - $SCRAM_ARCH\nBase image - $BASE_IMAGE\n"
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR/$REPO_NAME --dockerfile $CI_PROJECT_DIR/$REPO_NAME/Dockerfile --destination $CI_REGISTRY_IMAGE/$IMAGE_NAME:$DATE-$CI_COMMIT_SHORT_SHA --destination $CI_REGISTRY_IMAGE/$IMAGE_NAME:latest --build-arg=BUILD_DATE="$DATE" --build-arg=VERSION="$DATE" --build-arg=VCS_URL="$CI_REPOSITORY_URL" --build-arg=VCS_REF="$CI_COMMIT_SHORT_SHA" --build-arg BASEIMAGE="$BASE_IMAGE" --build-arg SCRAM_ARCH="$SCRAM_ARCH" --build-arg CMSSW_VERSION="$RELEASE"
- export DOCKER_AUTH="$(echo -n $DOCKER_USER:$DOCKER_PASS | base64)" # https://github.com/GoogleContainerTools/kaniko#pushing-to-docker-hub
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}, \"$DOCKER_REGISTRY\":{\"auth\":\"${DOCKER_AUTH}\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR/$REPO_NAME --dockerfile $CI_PROJECT_DIR/$REPO_NAME/Dockerfile --destination $CI_REGISTRY_IMAGE/$IMAGE_NAME:$DATE-$CI_COMMIT_SHORT_SHA --destination $CI_REGISTRY_IMAGE/$IMAGE_NAME:latest --destination $DOCKER_GROUP/$REPO_NAME:$IMAGE_NAME --build-arg=BUILD_DATE="$DATE" --build-arg=VERSION="$DATE" --build-arg=VCS_URL="$CI_REPOSITORY_URL" --build-arg=VCS_REF="$CI_COMMIT_SHORT_SHA" --build-arg BASEIMAGE="$BASE_IMAGE" --build-arg SCRAM_ARCH="$SCRAM_ARCH" --build-arg CMSSW_VERSION="$RELEASE"
- echo "export IMAGE_PATH=$CI_REGISTRY_IMAGE/$IMAGE_NAME:$DATE-$CI_COMMIT_SHORT_SHA" > standalone_image_path.env
artifacts:
paths:
......@@ -108,5 +109,7 @@ build_standalone_pipeline:
IMAGE_NAME: $RELEASE-$SCRAM_ARCH
REPO_NAME: standalone
BASE_IMAGE: "$CI_REGISTRY_IMAGE/$OS-cms:latest"
DOCKER_GROUP: cmscloud
DOCKER_REGISTRY: https://index.docker.io/v1/
# Necessary variables to be passed to Dockerfile for building a standalone image is CMSSW_VERSION=$RELEASE,
# SCRAM_ARCH=$SCRAM_ARCH and BASEIMAGE="gitlab-registry.cern.ch/cms-cloud/cmssw-docker/$OS-cms:latest"
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment