From fa1ca77d35e5b10f65a81b3d109d76a05f46a4bc Mon Sep 17 00:00:00 2001 From: TC Johnson Date: Mon, 29 Apr 2024 16:03:38 -0500 Subject: [PATCH] Further dry run trigger refinements The dry run should now be configured if changes to .gitlab-ci.yml, Earthfile, contents of scripts/cicd, or contents of package arrive as the result of a push OR merge but NOT when a tag is present. I think that will prevent the dry run executing alongside the actual release process when a new release tag is pushed but that also contains changes to the above mentioned files. --- .gitlab-ci.yml | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bc1ddf12..cdc4e271 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -191,11 +191,12 @@ dryrun_create_build_machines: - 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" + - if: ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event") && $CI_COMMIT_TAG == NULL changes: - .gitlab-ci.yml - scripts/cicd/**/* - Earthfile + - package/**/* dryrun_package_amd64_deb: stage: build_packages @@ -208,11 +209,12 @@ dryrun_package_amd64_deb: - earthly +package-linux-amd64-deb - bash scripts/cicd/build-machine/scp-to-orchestrator.sh rules: - - if: $CI_PIPELINE_SOURCE == "push" + - if: ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event") && $CI_COMMIT_TAG == NULL changes: - .gitlab-ci.yml - scripts/cicd/**/* - Earthfile + - package/**/* dryrun_package_arm64_deb: stage: build_packages @@ -225,12 +227,13 @@ dryrun_package_arm64_deb: - earthly +package-linux-arm64-deb - bash scripts/cicd/build-machine/scp-to-orchestrator.sh rules: - - if: $CI_PIPELINE_SOURCE == "push" + - if: ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event") && $CI_COMMIT_TAG == NULL changes: - .gitlab-ci.yml - scripts/cicd/**/* - Earthfile - + - package/**/* + dryrun_package_amd64_rpm: stage: build_packages needs: @@ -242,11 +245,12 @@ dryrun_package_amd64_rpm: - earthly +package-linux-amd64-rpm - bash scripts/cicd/build-machine/scp-to-orchestrator.sh rules: - - if: $CI_PIPELINE_SOURCE == "push" + - ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event") && $CI_COMMIT_TAG == NULL changes: - .gitlab-ci.yml - scripts/cicd/**/* - Earthfile + - package/**/* # dryrun_publish_crates: # stage: build_packages @@ -259,11 +263,12 @@ dryrun_package_amd64_rpm: # - 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" +# - if: ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event") && $CI_COMMIT_TAG == NULL # changes: # - .gitlab-ci.yml # - scripts/cicd/**/* # - Earthfile +# - package/**/* dryrun_publish_python: stage: build_packages @@ -272,14 +277,14 @@ dryrun_publish_python: tags: - build-amd64-deb script: - - vlt login - cd veilid-python && /home/gitlab-runner/.local/bin/poetry build rules: - - if: $CI_PIPELINE_SOURCE == "push" + - if: ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event") && $CI_COMMIT_TAG == NULL changes: - .gitlab-ci.yml - scripts/cicd/**/* - Earthfile + - package/**/* dryrun_build_repositories: stage: distribute @@ -291,11 +296,12 @@ dryrun_build_repositories: - cp scripts/cicd/build-orchestration/generate-release.sh ~ - bash scripts/cicd/build-orchestration/distribute-packages.sh rules: - - if: $CI_PIPELINE_SOURCE == "push" + - if: ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event") && $CI_COMMIT_TAG == NULL changes: - .gitlab-ci.yml - scripts/cicd/**/* - Earthfile + - package/**/* dryrun_deploy_repos: stage: distribute @@ -306,11 +312,12 @@ dryrun_deploy_repos: script: - ls -al repo.tar rules: - - if: $CI_PIPELINE_SOURCE == "push" + - if: ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event") && $CI_COMMIT_TAG == NULL changes: - .gitlab-ci.yml - scripts/cicd/**/* - Earthfile + - package/**/* dryrun_delete_build_machines: stage: distribute @@ -323,8 +330,9 @@ dryrun_delete_build_machines: - 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" + - if: ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event") && $CI_COMMIT_TAG == NULL changes: - .gitlab-ci.yml - scripts/cicd/**/* - - Earthfile \ No newline at end of file + - Earthfile + - package/**/* \ No newline at end of file