From 392d87395ccd3498748525f65131dc83d430dbd0 Mon Sep 17 00:00:00 2001 From: Joseph Montanaro Date: Tue, 23 Nov 2021 15:43:24 -0800 Subject: [PATCH] use tag instead of promote to trigger build pipelines --- .drone.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.drone.yml b/.drone.yml index a466ca6..fd60763 100644 --- a/.drone.yml +++ b/.drone.yml @@ -37,8 +37,8 @@ steps: - | if [[ $COMMIT_HASH != $IMAGE_COMMIT_HASH ]]; then echo -e '\033[1;33mUpdates available, triggering server build.\033[0m' - curl -X POST -H "Authorization: Bearer $DRONE_API_TOKEN" \ - https://drone.jfmonty2.com/api/repos/jfmonty2/drone/builds/$DRONE_BUILD_NUMBER/promote?target=server-build + curl -X POST -H "Authorization: token $GITEA_API_TOKEN" -H "Content-Type: application/json" \ + https://git.jfmonty2.com/api/v1/repos/jfmonty2/drone/tags -d "{\"tag_name\": \"server-$LATEST_VERSION\"}" else echo -e '\033[0;32mServer is already up to date.\033[0m' fi @@ -53,8 +53,8 @@ steps: - | if [[ $LATEST_VERSION != $CURRENT_VERSION ]]; then echo -e '\033[1;33mNew release available, triggering runner build.\033[0m' - curl -X POST -H "Authorization: Bearer $DRONE_API_TOKEN" \ - https://drone.jfmonty2.com/api/repos/jfmonty2/drone/builds/$DRONE_BUILD_NUMBER/promote?target=runner-build + curl -X POST -H "Authorization: token $GITEA_API_TOKEN" -H "Content-Type: application/json" \ + https://git.jfmonty2.com/api/v1/repos/jfmonty2/drone/tags -d "{\"tag_name\": \"runner-exec-$LATEST_VERSION\"}" else echo -e '\033[0;32mRunner is already up to date.\033[0m' fi @@ -72,9 +72,9 @@ name: server trigger: event: - - promote - target: - - server-build + - tag + ref: + - refs/tags/server-* steps: - name: prepare @@ -149,9 +149,9 @@ name: runner-exec trigger: event: - - promote - target: - - runner-build + - tag + ref: + - refs/tags/runner-exec-* steps: - name: docker-build