Commit 563715a3 authored by Alexx Perloff's avatar Alexx Perloff
Browse files

Try to build the image once and push to both the GitLab and DockerHub registries.

parent d3dc7402
Pipeline #2636780 canceled with stage
in 15 seconds
......@@ -29,7 +29,7 @@ before_script:
- ls -alh ${CI_PROJECT_DIR}/${CONTEXT_DIR}/
- echo "Logging into the registry ${CI_REGISTRY}"
- export DOCKER_AUTH="$(echo -n $DOCKER_USERNAME:$DOCKER_PASSWORD | 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
- 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}/${CONTEXT_DIR} --dockerfile ${CI_PROJECT_DIR}/${CONTEXT_DIR}/Dockerfile --destination "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${CMSSW_VERSION}-${DATE}-${CI_COMMIT_SHORT_SHA}" --destination "${DOCKER_GROUP}/${IMAGE_NAME}:${CMSSW_VERSION}-${DATE}-${CI_COMMIT_SHORT_SHA}" --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="${CMSSW_VERSION}"
# Jobs/Includes ---------------------------------------------------------------
......
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