Skip to content

Commit

Permalink
fix: deploy webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
achauve committed Sep 2, 2024
1 parent b25aea4 commit a2f1797
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .gitlab-ci-dso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,16 @@ deploy:
script:
- echo "Deploying $IMAGE_NAME from branch $CI_COMMIT_REF_SLUG"
- |
if [[ "$CI_COMMIT_REF_SLUG" == "main" || "$CI_COMMIT_REF_SLUG" == "preprod" ]]; then
if [[ "$CI_COMMIT_REF_SLUG" == "cloud-pi-demo" ]]; then
ENVIRONMENT=main
elif [[ "$CI_COMMIT_REF_SLUG" == "cloud-pi-demo-preprod" ]]; then
ENVIRONMENT=preprod
fi
if [[ -n "$ENVIRONMENT" ]]; then
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $GITHUB_TOKEN_INFRA_REPO" \
https://api.github.com/repos/DNUm-socialgouv/vao-infra-pi/dispatches \
-d '{"event_type":"deploy-event", "client_payload": {"environment": "$CI_COMMIT_REF_SLUG", "appTag": "$TAG"}}'
-d '{"event_type":"deploy-event", "client_payload": {"environment": "$ENVIRONMENT", "appTag": "$TAG"}}'
fi

0 comments on commit a2f1797

Please sign in to comment.