Added CICD dry run

This is the first attempt at setting up a dry run pipeline
to test changes to the CICD config without actually publishing
the compiled binaries and packages built by the process.

The dry run should be triggered by any changes to .gitlab-ci.yml
or changes to any of the scripts under scripts/cicd/.
This commit is contained in:
TC Johnson 2024-04-29 14:40:07 -05:00
parent 6c6be00feb
commit 038f4d2121
No known key found for this signature in database

View File

@ -55,6 +55,8 @@ test_build:
resource_group: test
# when: manual
# Actual release -- triggered by pushing a new version tag
release_job:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
@ -177,3 +179,143 @@ delete_build_machines:
- bash scripts/cicd/build-orchestration/build-machine-ctrl.sh delete amd64-rpm
rules:
- if: '$CI_COMMIT_TAG =~ /v\d.+/'
# Dryrun release -- triggered by changes in .gitlab-ci.yml or CICD scripts
dryrun_create_build_machines:
stage: build_packages
tags:
- build-orchestration
script:
- bash scripts/cicd/build-orchestration/build-machine-ctrl.sh create amd64-deb
- bash scripts/cicd/build-orchestration/build-machine-ctrl.sh create arm64-deb
- bash scripts/cicd/build-orchestration/build-machine-ctrl.sh create amd64-rpm
rules:
- if: $CI_PIPELINE_SOURCE == "push"
changes:
- .gitlab-ci.yml
- scripts/cicd/**/*
dryrun_package_amd64_deb:
stage: build_packages
needs:
- dryrun_create_build_machines
tags:
- build-amd64-deb
script:
- earthly bootstrap
- earthly +package-linux-amd64-deb
- bash scripts/cicd/build-machine/scp-to-orchestrator.sh
rules:
- if: $CI_PIPELINE_SOURCE == "push"
changes:
- .gitlab-ci.yml
- scripts/cicd/**/*
dryrun_package_arm64_deb:
stage: build_packages
needs:
- dryrun_create_build_machines
tags:
- build-arm64-deb
script:
- earthly bootstrap
- earthly +package-linux-arm64-deb
- bash scripts/cicd/build-machine/scp-to-orchestrator.sh
rules:
- if: $CI_PIPELINE_SOURCE == "push"
changes:
- .gitlab-ci.yml
- scripts/cicd/**/*
dryrun_package_amd64_rpm:
stage: build_packages
needs:
- dryrun_create_build_machines
tags:
- build-amd64-rpm
script:
- earthly bootstrap
- earthly +package-linux-amd64-rpm
- bash scripts/cicd/build-machine/scp-to-orchestrator.sh
rules:
- if: $CI_PIPELINE_SOURCE == "push"
changes:
- .gitlab-ci.yml
- scripts/cicd/**/*
dryrun_publish_crates:
stage: build_packages
needs:
- dryrun_create_build_machines
tags:
- build-amd64-deb
script:
- vlt login
- vlt run --command="cargo publish -p veilid-tools --dry-run"
- vlt run --command="cargo publish -p veilid-core --dry-run"
rules:
- if: $CI_PIPELINE_SOURCE == "push"
changes:
- .gitlab-ci.yml
- scripts/cicd/**/*
dryrun_publish_python:
stage: build_packages
needs:
- dryrun_create_build_machines
tags:
- build-amd64-deb
script:
- vlt login
- cd veilid-python && /home/gitlab-runner/.local/bin/poetry build
rules:
- if: $CI_PIPELINE_SOURCE == "push"
changes:
- .gitlab-ci.yml
- scripts/cicd/**/*
dryrun_build_repositories:
stage: distribute
tags:
- build-orchestration
variables:
SECURE_FILES_DOWNLOAD_PATH: './'
script:
- cp scripts/cicd/build-orchestration/generate-release.sh ~
- bash scripts/cicd/build-orchestration/distribute-packages.sh
rules:
- if: $CI_PIPELINE_SOURCE == "push"
changes:
- .gitlab-ci.yml
- scripts/cicd/**/*
dryrun_deploy_repos:
stage: distribute
needs:
- dryrun_build_repositories
tags:
- repo-server
script:
- ls -al repo.tar
rules:
- if: $CI_PIPELINE_SOURCE == "push"
changes:
- .gitlab-ci.yml
- scripts/cicd/**/*
dryrun_delete_build_machines:
stage: distribute
needs:
- dryrun_deploy_repos
tags:
- build-orchestration
script:
- bash scripts/cicd/build-orchestration/build-machine-ctrl.sh delete amd64-deb
- bash scripts/cicd/build-orchestration/build-machine-ctrl.sh delete arm64-deb
- bash scripts/cicd/build-orchestration/build-machine-ctrl.sh delete amd64-rpm
rules:
- if: $CI_PIPELINE_SOURCE == "push"
changes:
- .gitlab-ci.yml
- scripts/cicd/**/*