Commit 8393fa32 authored by Alexx Perloff's avatar Alexx Perloff
Browse files

More environment variable simplification.

parent 034fa70f
Pipeline #1549271 failed with stage
in 4 minutes and 4 seconds
......@@ -14,10 +14,6 @@ before_script:
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:
......@@ -27,11 +23,12 @@ before_script:
# Build and push the image from the Dockerfile at the root of the project.
# 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 ${REGISTRY_IMAGE}/${IMAGE_NAME}:${CMSSW_VERSION}-${DATE}-${CI_COMMIT_SHORT_SHA} with ${CMSSW_VERSION} and ${SCRAM_ARCH}" on ${DATE}
- 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 "${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}"
- echo "Logging into the registry ${CI_REGISTRY}"
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"username\":\"${CI_REGISTRY_USER}\",\"password\":\"${CI_REGISTRY_PASSWORD}\"}}}" > /kaniko/.docker/config.json
- echo "Building standalone image ${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${CMSSW_VERSION}-${DATE}-${CI_COMMIT_SHORT_SHA} with ${CMSSW_VERSION} and ${SCRAM_ARCH}" on ${DATE}
- /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}"
# Jobs/Includes ---------------------------------------------------------------
include:
......
......@@ -11,7 +11,7 @@ build_TreeMaker_cmssw_standalone_CMSSW_10_2_21_dockerhub:
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/${REPO_NAME}
\ No newline at end of file
CI_REGISTRY: docker.io
CI_REGISTRY_USER: ${DOCKER_USERNAME}
CI_REGISTRY_PASSWORD: ${DOCKER_PASSWORD}
CI_REGISTRY_IMAGE: index.docker.io/${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