Commit 7816f2fc authored by Clemens Lange's avatar Clemens Lange
Browse files

Introduce build template

parent 4b516b77
......@@ -8,7 +8,7 @@ before_script:
variables:
COMMIT_HASH: $CI_COMMIT_SHORT_SHA
check changed files:
check_changed_files:
stage: check
only:
changes: [cc7-cms/*, cc7-cvmfs/*, slc6-cms/*, slc6-cvmfs/*, slc5-cms/*]
......@@ -19,7 +19,7 @@ check changed files:
script:
- ./check.sh
build standalone:
build_standalone:
stage: build
only:
variables:
......@@ -37,11 +37,8 @@ build standalone:
- 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:$CMSSW_VERSION-$DATE-$COMMIT_HASH --build-arg=BUILD_DATE="$DATE" --build-arg=VERSION="$DATE" --build-arg=VCS_URL="$CI_REPOSITORY_URL" --build-arg=VCS_REF="$COMMIT_HASH" --build-arg BASEIMAGE="clelange/$BASE_IMAGE-cms:latest" --build-arg SCRAM_ARCH="$SCRAM_ARCH" --build-arg CMSSW_VERSION="$CMSSW_VERSION"
build cms cvmfs:
stage: build
only:
variables:
- $CI_PIPELINE_SOURCE == "pipeline" && $IMAGE_NAME
.build_cms_cvmfs_template: &build_cms_cvmfs
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
......@@ -49,3 +46,11 @@ build cms cvmfs:
- echo "Building image for $IMAGE_NAME"
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR/$IMAGE_NAME --dockerfile $CI_PROJECT_DIR/$IMAGE_NAME/Dockerfile --destination $CI_REGISTRY_IMAGE/$IMAGE_NAME:$DATE-$COMMIT_HASH --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="$COMMIT_HASH"
build_cms_cvmfs_pipeline:
<<: *build_cms_cvmfs
stage: build
only:
variables:
- $IMAGE_NAME
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