Added comments to
check.sh as well as added a test template.
How it works:
check_changes_pipeline is triggered at push or merge request. It has two jobs
- to trigger the build of "production images" if on master (
- to trigger "testing images" if on non-master branch (
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
build_standalone_pipeline are only triggered on master.
It seems like the first line of
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
- Changes are pushed to a branch
check.shtriggers the build of "testing images"
- If everything looks good we merge the branch into master
check.shis triggered however it doesn't find any changed files
- No "production images" are built
I haven't found a way around this yet.