Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • C cmssw-docker
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 13
    • Issues 13
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • cms-cloud
  • cmssw-docker
  • Merge requests
  • !12
The source project of this merge request has been removed.

add pipeline for building docker images

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Adelina Eleonora Lintuluoto requested to merge alintulu/cmssw-docker:build-ci into master May 13, 2020
  • Overview 1
  • Commits 2
  • Changes 2

The pipeline contains two different build jobs, building a standalone or a cms/cvmfs version. In addition it contains a job for checking which files have been modified, enabling to trigger the build of the cms/cvmfs version that was changed. Only reason for there to be a separate script check.sh and not just a multi line script is because I didn't get the multi line syntax to work with a for loop

script:
  - >

If you know how to fix it we can transfer the code in check.sh to the pipeline!


The two build jobs:

  • A standalone build is triggered when the variables CMSSW_VERSION, SCRAM_ARCH and BASE_IMAGE is passed, could be passed with a webhook.

  • A cms/cvmfs version is built when there has been a change in the directory containing the Dockerfile corresponding to the image. Since there is only one job but five directories, before building, the job has to set the IMAGE_NAME variable to indicate which image to build (cc7-cms/cvmfs, slc6-cms/cvmfs, slc5-cms). This is set with the job check changed files

The file check.sh calls

files=$(git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA)

which returns a list of all files that has been modified. The directory of the file is checked and the pipeline is triggered again, this time with the variable IMAGE_NAME set to the directory name. (The reason why the job tags docker is because the runner has git installed).

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: build-ci