diff options
-rw-r--r-- | .gitlab-ci.yml | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 64e13fcb0..efe5eb2cd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -528,6 +528,9 @@ start-rails-specs: --data "content=$CI_MERGE_REQUEST_SOURCE_BRANCH_SHA" \ --data "commit_message=Updating GITALY_SERVER_VERSION to $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA" \ https://gitlab.com/api/v4/projects/278964/repository/files/GITALY_SERVER_VERSION + environment: + name: merge-requests/$CI_MERGE_REQUEST_IID + on_stop: rails-specs-cleanup rules: - when: manual allow_failure: true @@ -551,6 +554,23 @@ rails-specs-cleanup: - | curl --request DELETE --header "PRIVATE-TOKEN: $GITLAB_PROJECT_TOKEN" \ "https://gitlab.com/api/v4/projects/278964/repository/branches/$RAILS_BRANCH_FOR_MERGE_REQUEST" + environment: + name: merge-requests/$CI_MERGE_REQUEST_IID + action: stop + +cleanup-rails-spec-test-env: + needs: [] + stage: qa + before_script: + - apt update + - apt install -y jq + script: + - | + ENV_ID=$(curl -s --request GET --header "PRIVATE-TOKEN: $GITALY_PROJECT_TOKEN" "https://gitlab.com/api/v4/projects/2009901/environments?name=merge-requests%2F$CI_MERGE_REQUEST_IID" | jq '.[0].id') + curl -s --request DELETE --header "PRIVATE-TOKEN: $GITALY_PROJECT_TOKEN" "https://gitlab.com/api/v4/projects/2009901/environments/$ENV_ID" + rules: + - when: manual + allow_failure: true build-package-and-qa: needs: [] |