Skip to content

CI add comments and test buidling

Adelina Eleonora Lintuluoto requested to merge ci into master

Added comments to gitlab-ci.yml and check.sh as well as added a test template.

How it works:

The job check_changes_pipeline is triggered at push or merge request. It has two jobs

  1. to trigger the build of "production images" if on master (--form ref=$CI_DEFAULT_BRANCH )
  2. to trigger "testing images" if on non-master branch (--form ref=$CI_COMMIT_BRANCH)

The job test_all_pipeline is triggered only on non-master branches and expects a variable $TEST in addition to $IMAGE_NAME. (The variable $TEST is probably unnecessary since it only runs on non-master branches and check.sh only triggers the build of "testing images" only on non-master branches.) The test images are pushed to https://gitlab.cern.ch/cms-cloud/cmssw-docker/test.

The jobs build_cms_cvmfs_pipeline and build_standalone_pipeline are only triggered on master.

One issue:

It seems like the first line of check.sh (git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA) is empty if the commit came from a merge request. This means that in a scenario like

  1. Changes are pushed to a branch
  2. check.sh triggers the build of "testing images"
  3. If everything looks good we merge the branch into master
  4. check.sh is triggered however it doesn't find any changed files
  5. No "production images" are built

I haven't found a way around this yet.

Merge request reports