Commit 5e0e2af5 authored by Alexx Perloff's avatar Alexx Perloff
Browse files

Add a job which pushes to the DockerHub registry rather than the GitLab registry.

parent fc019a29
Pipeline #1549138 failed
......@@ -11,9 +11,13 @@ before_script:
stage: build
variables:
NO_CACHE: "true"
CONTEXT_DIR: "${REPO_NAME}/"
REPO_NAME: standalone
REPO_NAME: treemaker
CONTEXT_DIR: "standalone/"
IMAGE_NAME: cmssw
REGISTRY: ${CI_REGISTRY}
REGISTRY_USER: ${CI_REGISTRY_USER}
REGISTRY_PASSWORD: ${CI_REGISTRY_PASSWORD}
REGISTRY_IMAGE: ${CI_REGISTRY_IMAGE}
tags:
- docker-privileged-xl
image:
......@@ -24,10 +28,10 @@ before_script:
# To push to a specific docker tag, amend the --destination parameter, e.g. --destination $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
# See https://docs.gitlab.com/ee/ci/variables/predefined_variables.html#variables-reference for available variables
- echo "Building standalone image ${TO} with ${CMSSW_VERSION} and ${SCRAM_ARCH}" on ${DATE}
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- echo "{\"auths\":{\"${REGISTRY}\":{\"username\":\"${REGISTRY_USER}\",\"password\":\"${REGISTRY_PASSWORD}\"}}}" > /kaniko/.docker/config.json
- echo ${CI_PROJECT_DIR}/${CONTEXT_DIR}/
- ls -alh ${CI_PROJECT_DIR}/${CONTEXT_DIR}/
- /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}" --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}"
- /kaniko/executor --context ${CI_PROJECT_DIR}/${CONTEXT_DIR} --dockerfile ${CI_PROJECT_DIR}/${CONTEXT_DIR}/Dockerfile --destination "${REGISTRY_IMAGE}/${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 ---------------------------------------------------------------
include:
......
......@@ -4,3 +4,14 @@ build_TreeMaker_cmssw_standalone_CMSSW_10_2_21:
CMSSW_VERSION: CMSSW_10_2_21
SCRAM_ARCH: slc7_amd64_gcc700
BASE_IMAGE: clelange/cc7-cms:latest
build_TreeMaker_cmssw_standalone_CMSSW_10_2_21_dockerhub:
extends: .job_template
variables:
CMSSW_VERSION: CMSSW_10_2_21
SCRAM_ARCH: slc7_amd64_gcc700
BASE_IMAGE: clelange/cc7-cms:latest
REGISTRY: docker.io
REGISTRY_USER: ${DOCKER_USERNAME}
REGISTRY_PASSWORD: ${DOCKER_PASSWORD}
REGISTRY_IMAGE: index.docker.io/${REGISTRY_USER}/${REPO_NAME}
\ 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