From 2b2f02b8054559de95b14320da7a1b7e2876f954 Mon Sep 17 00:00:00 2001 From: Nick Vanpraet Date: Wed, 30 Oct 2024 17:13:03 +0100 Subject: [PATCH 1/4] Add attribution --- .github/scripts/mirror.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/mirror.sh b/.github/scripts/mirror.sh index 9730ac8e..e01a68c3 100755 --- a/.github/scripts/mirror.sh +++ b/.github/scripts/mirror.sh @@ -7,7 +7,6 @@ echo "Triggering git reference: ${GITHUB_REF}" echo "Triggering git reference for push events: ${GH_REF}" echo "Triggering git reference type: ${GH_REF_TYPE}" - function git-setup() { printf -v url "https://%s:%s@%s" \ "${GITLAB_USERNAME}" \ @@ -18,6 +17,7 @@ function git-setup() { set -x } +# @see https://github.com/xometry/gitlab-mirror-action/tree/master if test "$GITHUB_EVENT_NAME" == "create"; then # Do nothing. Every "create" event *also* publishes a *push* event, even tags/branches created from github UI. # Duplicate events would race and sometimes cause spurious errors. From 450ba0772c056d41d99031c5a9e9bb0f5f244340 Mon Sep 17 00:00:00 2001 From: Nick Vanpraet Date: Wed, 30 Oct 2024 17:21:27 +0100 Subject: [PATCH 2/4] Update CI file --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5a465070..e503959c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,7 @@ deploy_to_qa_1: - >- curl --url 'https://admin.platform.dropsolid.com/project/mauticorg/environment/qa1/action.build?_format=json' - --data '{"branch":"'"${CI_COMMIT_REF_NAME}"'", "plugin_id": "git_reference"}' + --data '{"git_reference":"'"${CI_COMMIT_REF_NAME}"'", "plugin_id": "git_reference", "run_after_sync_tasks": true}' --header 'Content-type:application/json' --header "Authorization:Bearer ${GITLAB_API_TOKEN}" only: @@ -37,7 +37,7 @@ deploy_to_qa_2: - >- curl --url 'https://admin.platform.dropsolid.com/project/mauticorg/environment/qa2/action.build?_format=json' - --data '{"branch":"'"${CI_COMMIT_REF_NAME}"'", "plugin_id": "git_reference"}' + --data '{"git_reference":"'"${CI_COMMIT_REF_NAME}"'", "plugin_id": "git_reference", "run_after_sync_tasks": true}' --header 'Content-type:application/json' --header "Authorization:Bearer ${GITLAB_API_TOKEN}" only: @@ -58,7 +58,7 @@ deploy_to_qa_3: - >- curl --url 'https://admin.platform.dropsolid.com/project/mauticorg/environment/qa3/action.build?_format=json' - --data '{"branch":"'"${CI_COMMIT_REF_NAME}"'", "plugin_id": "git_reference"}' + --data '{"git_reference":"'"${CI_COMMIT_REF_NAME}"'", "plugin_id": "git_reference", "run_after_sync_tasks": true}' --header 'Content-type:application/json' --header "Authorization:Bearer ${GITLAB_API_TOKEN}" only: @@ -79,7 +79,7 @@ deploy_to_qa_4: - >- curl --url 'https://admin.platform.dropsolid.com/project/mauticorg/environment/qa4/action.build?_format=json' - --data '{"branch":"'"${CI_COMMIT_REF_NAME}"'", "plugin_id": "git_reference"}' + --data '{"git_reference":"'"${CI_COMMIT_REF_NAME}"'", "plugin_id": "git_reference", "run_after_sync_tasks": true}' --header 'Content-type:application/json' --header "Authorization:Bearer ${GITLAB_API_TOKEN}" only: From ff4cebff7e08595729c810502d63e4874a236e32 Mon Sep 17 00:00:00 2001 From: Nick Vanpraet Date: Wed, 30 Oct 2024 17:21:47 +0100 Subject: [PATCH 3/4] Do not exclude CI file for PR sync (will be reverted) --- .github/scripts/create_qa_branch_for_pr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/create_qa_branch_for_pr.sh b/.github/scripts/create_qa_branch_for_pr.sh index 10edefac..3ebaa588 100755 --- a/.github/scripts/create_qa_branch_for_pr.sh +++ b/.github/scripts/create_qa_branch_for_pr.sh @@ -8,7 +8,7 @@ git config user.name github-actions git config user.email github-actions@github.com git checkout -b internal/qa-${QA_ENV}/PR-${PR_NUMBER}/${GITHUB_HEAD_REF} cd .. -rsync -avz --delete --exclude=.git --exclude=.github --exclude=.gitlab-ci.yml pr/ main +rsync -avz --delete --exclude=.git --exclude=.github pr/ main cd main git add . git commit -m "Created QA branch for PR ${PR_NUMBER}" From 98381807bb7933dcc7835119c3e8c0fcdfcda2e0 Mon Sep 17 00:00:00 2001 From: Nick Vanpraet Date: Wed, 30 Oct 2024 17:24:04 +0100 Subject: [PATCH 4/4] Revert "Do not exclude CI file for PR sync (will be reverted)" This reverts commit ff4cebff7e08595729c810502d63e4874a236e32. --- .github/scripts/create_qa_branch_for_pr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/create_qa_branch_for_pr.sh b/.github/scripts/create_qa_branch_for_pr.sh index 3ebaa588..10edefac 100755 --- a/.github/scripts/create_qa_branch_for_pr.sh +++ b/.github/scripts/create_qa_branch_for_pr.sh @@ -8,7 +8,7 @@ git config user.name github-actions git config user.email github-actions@github.com git checkout -b internal/qa-${QA_ENV}/PR-${PR_NUMBER}/${GITHUB_HEAD_REF} cd .. -rsync -avz --delete --exclude=.git --exclude=.github pr/ main +rsync -avz --delete --exclude=.git --exclude=.github --exclude=.gitlab-ci.yml pr/ main cd main git add . git commit -m "Created QA branch for PR ${PR_NUMBER}"