Commit ae700d90 authored by Thomas Mc Cauley's avatar Thomas Mc Cauley
Browse files

Merge branch 'hi_flag' into 'master'

Add HI flag to CI logic

See merge request !6
parents d76e1011 472f11a4
Pipeline #4802542 failed with stages
in 3 minutes and 28 seconds
......@@ -21,11 +21,15 @@ choose-image-web:
script:
- echo ${RELEASE} > .baseimage
- cat .baseimage
- echo ${HI} > .hi
- cat .hi
artifacts:
paths:
- .baseimage
- .hi
variables:
RELEASE: "cmssw_7_6_7-slc6_amd64_gcc493"
HI: "0" # False
build-image:
stage: build
......@@ -41,12 +45,14 @@ build-image:
script:
- export DATE=$(date +"%Y-%m-%d")
- export IMAGE_NAME=$(cat .baseimage)
- export HI=$(cat .hi)
- export BASE_IMAGE=${BASE_REGISTRY}/${IMAGE_NAME}:latest
- echo "Building image - $IMAGE_NAME"
- echo "Heavy Ion flag - $HI"
- echo "Base image - $BASE_IMAGE"
- 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}" --destination $CI_REGISTRY_IMAGE/$IMAGE_NAME:$DATE-$CI_COMMIT_SHORT_SHA --destination $CI_REGISTRY_IMAGE/$IMAGE_NAME:latest --destination $DOCKER_GROUP/$IMAGE_NAME --build-arg=IMAGEBASE="$BASE_IMAGE" --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"
- /kaniko/executor --context "${CI_PROJECT_DIR}" --destination $CI_REGISTRY_IMAGE/$IMAGE_NAME:$DATE-$CI_COMMIT_SHORT_SHA --destination $CI_REGISTRY_IMAGE/$IMAGE_NAME:latest --destination $DOCKER_GROUP/$IMAGE_NAME --build-arg=IMAGEBASE="$BASE_IMAGE" --build-arg=HI="$HI" --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"
variables:
BASE_REGISTRY: "gitlab-registry.cern.ch/cms-cloud/cmssw-docker"
DOCKER_GROUP: cmsopendata
......
......@@ -5,6 +5,9 @@ ARG USERNAME=cmsusr
# Make this a build arg since we don't know the imagebase
# since it's defined before FROM
ARG CMSSW_VERSION=CMSSW_4_2_8
# Are we making an image for HI (Heavy Ions)?
# No, by default.
ARG HI=0
USER root
......@@ -52,10 +55,6 @@ RUN mkdir -p /home/${USERNAME}/.vnc
ADD --chown=cmsusr:cmsusr vnc/xstartup /home/${USERNAME}/.vnc/xstartup
ADD --chown=cmsusr:cmsusr vnc/passwd /home/${USERNAME}/.vnc/passwd
# Are we making an image for HI (Heavy Ions)?
# No, by default.
ARG HI=0
RUN if [[ $HI = "1" ]]; \
then \
echo "Setting up ${CMSSW_VERSION}" \
......
......@@ -2,5 +2,6 @@ cmssw_3_9_2_patch5-slc5_amd64_gcc434
cmssw_4_2_8-slc5_amd64_gcc434
cmssw_4_2_8_lowpupatch1-slc5_amd64_gcc434
cmssw_4_4_7-slc5_amd64_gcc434
cmssw_5_3_20-slc6_amd64_gcc472
cmssw_5_3_32-slc6_amd64_gcc472
cmssw_7_6_7-slc6_amd64_gcc493
\ 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