diff --git a/.gitlab/ci/pipelines/octez_beta_release_tag.yml b/.gitlab/ci/pipelines/octez_beta_release_tag.yml index 58da7e4af59d31b8a5305266aec5170546a336be..fd9211b1126c92704770db78eb6156af1c38f7e4 100644 --- a/.gitlab/ci/pipelines/octez_beta_release_tag.yml +++ b/.gitlab/ci/pipelines/octez_beta_release_tag.yml @@ -1503,9 +1503,7 @@ dispatch-call: - . ./scripts/ci/datadog_send_job_info.sh - . ./scripts/ci/datadog_send_job_cache_info.sh 'before' script: - - 'curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer - ${TEZCAPITAL_GITHUB_TOKEN}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/tez-capital/tezos-macos-pipeline/actions/workflows/macos.yml/dispatches - -d ''{"ref":"main","inputs":{"version": "${CI_COMMIT_TAG}"}}''' + - ./scripts/releases/dispatch-call.sh - . ./scripts/ci/datadog_send_job_script_step_time.sh || true after_script: - . ./scripts/ci/datadog_send_job_cache_info.sh 'after' diff --git a/.gitlab/ci/pipelines/octez_major_release_tag.yml b/.gitlab/ci/pipelines/octez_major_release_tag.yml index 48618ad56d7e5681588a92f31d2c24cb61491838..f804c7c06dbd9e1a74b5b8b12e39813f8ee2c278 100644 --- a/.gitlab/ci/pipelines/octez_major_release_tag.yml +++ b/.gitlab/ci/pipelines/octez_major_release_tag.yml @@ -1525,9 +1525,7 @@ dispatch-call: - . ./scripts/ci/datadog_send_job_info.sh - . ./scripts/ci/datadog_send_job_cache_info.sh 'before' script: - - 'curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer - ${TEZCAPITAL_GITHUB_TOKEN}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/tez-capital/tezos-macos-pipeline/actions/workflows/macos.yml/dispatches - -d ''{"ref":"main","inputs":{"version": "${CI_COMMIT_TAG}"}}''' + - ./scripts/releases/dispatch-call.sh - . ./scripts/ci/datadog_send_job_script_step_time.sh || true after_script: - . ./scripts/ci/datadog_send_job_cache_info.sh 'after' diff --git a/.gitlab/ci/pipelines/octez_minor_release_tag.yml b/.gitlab/ci/pipelines/octez_minor_release_tag.yml index 310e0fc5f81a8a0e2cbbad3d29fad4a91d46a52f..559de07b0b51437eb285e0f1a73108ca1e9af99b 100644 --- a/.gitlab/ci/pipelines/octez_minor_release_tag.yml +++ b/.gitlab/ci/pipelines/octez_minor_release_tag.yml @@ -1054,9 +1054,7 @@ dispatch-call: - . ./scripts/ci/datadog_send_job_info.sh - . ./scripts/ci/datadog_send_job_cache_info.sh 'before' script: - - 'curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer - ${TEZCAPITAL_GITHUB_TOKEN}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/tez-capital/tezos-macos-pipeline/actions/workflows/macos.yml/dispatches - -d ''{"ref":"main","inputs":{"version": "${CI_COMMIT_TAG}"}}''' + - ./scripts/releases/dispatch-call.sh - . ./scripts/ci/datadog_send_job_script_step_time.sh || true after_script: - . ./scripts/ci/datadog_send_job_cache_info.sh 'after' diff --git a/ci/lib_tezos_ci_jobs/release_tag.ml b/ci/lib_tezos_ci_jobs/release_tag.ml index 79b6c1f4bd899d7a6dcf2ac6a3b96ae5aa1ec1ec..f814102a7d496fe11cf796c79111217e8059c7d0 100644 --- a/ci/lib_tezos_ci_jobs/release_tag.ml +++ b/ci/lib_tezos_ci_jobs/release_tag.ml @@ -310,14 +310,7 @@ let octez_jobs ?(test = false) ?(major = true) release_tag_pipeline_type = ~name:"dispatch-call" ~dependencies: (Dependent [Job job_release_page; Job job_gitlab_release_or_publish]) - [ - "curl -L -X POST -H \"Accept: application/vnd.github+json\" -H \ - \"Authorization: Bearer ${TEZCAPITAL_GITHUB_TOKEN}\" -H \ - \"X-GitHub-Api-Version: 2022-11-28\" \ - https://api.github.com/repos/tez-capital/tezos-macos-pipeline/actions/workflows/macos.yml/dispatches \ - -d '{\"ref\":\"main\",\"inputs\":{\"version\": \ - \"${CI_COMMIT_TAG}\"}}'"; - ] + ["./scripts/releases/dispatch-call.sh"] in let job_trigger_monitoring = trigger_job diff --git a/scripts/releases/dispatch-call.sh b/scripts/releases/dispatch-call.sh new file mode 100755 index 0000000000000000000000000000000000000000..cfa61f2659ec8c1d670457edabfe01f2eb33e0f0 --- /dev/null +++ b/scripts/releases/dispatch-call.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +set -e + +if [ -z "${TEZCAPITAL_GITHUB_TOKEN}" ]; then + echo "TEZCAPITAL_GITHUB_TOKEN is not set" + exit 1 +fi + +if [ -z "${CI_COMMIT_TAG}" ]; then + echo "CI_COMMIT_TAG is not set" + exit 1 +fi + +curl -L -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${TEZCAPITAL_GITHUB_TOKEN}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/tez-capital/tezos-macos-pipeline/actions/workflows/macos.yml/dispatches \ + -d "{\"ref\":\"main\",\"inputs\":{\"version\": \"${CI_COMMIT_TAG}\"}}"