Allow multiple major versions to be updated
Why is this change being made?
As part of bumping the analyzer version to 5.0.0, we'll need to keep releasing updates to previous major versions as per our support policy.
This MR updates the trigger_db_update
rake task, which is called by the trigger-db-update
CI job, to trigger builds for every requested major version.
The TRIGGER_DB_UPDATE
CI variable was renamed to TRIGGER_DB_UPDATE_FOR_MAJOR_VERSIONS
, and accepts a comma-separated list of major versions.
To test locally:
Start a container and install dependencies
docker run -it --rm -v $(pwd):/ci ruby:2.7-alpine sh
In the container, install dependencies
cd /ci
apk add git build-base
bundle config --local jobs "$(nproc)"
bundle config set no-cache 'true'
bundle install --quiet
Run the new task
/ci # TRIGGER_DB_UPDATE_FOR_MAJOR_VERSIONS=4 CI_PIPELINE_SOURCE=schedule CI_PROJECT_ID=35650847 CS_TOKEN=<redacted> CI_PROJECT_PATH=thiagoconde/container-scanning bundle exec rake trigger_db_update
Triggered pipeline for 4.6.999: https://gitlab.com/thiagoconde/container-scanning/-/pipelines/526555409
/ci # TRIGGER_DB_UPDATE_FOR_MAJOR_VERSIONS=5 CI_PIPELINE_SOURCE=schedule CI_PROJECT_ID=35650847 CS_TOKEN=<redacted> CI_PROJECT_PATH=thiagoconde/container-scanning bundle exec rake trigger_db_update
Triggered pipeline for 5.0.0: https://gitlab.com/thiagoconde/container-scanning/-/pipelines/526555537
/ci # TRIGGER_DB_UPDATE_FOR_MAJOR_VERSIONS=5,4 CI_PIPELINE_SOURCE=schedule CI_PROJECT_ID=35650847 CS_TOKEN=<redacted> CI_PROJECT_PATH=thiagoconde/container-scanning bundle exec rake trigger_db_update
Triggered pipeline for 5.0.0: https://gitlab.com/thiagoconde/container-scanning/-/pipelines/526555653
Triggered pipeline for 4.6.999: https://gitlab.com/thiagoconde/container-scanning/-/pipelines/526555695
Observe that pipelines were triggered for the correct refs:
Related issue: gitlab-org/gitlab#360026 (closed)