-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathoutput-force-deploy
More file actions
executable file
·23 lines (22 loc) · 1.11 KB
/
output-force-deploy
File metadata and controls
executable file
·23 lines (22 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
# Set automatically by CircleCI
: ${CIRCLE_PROJECT_REPONAME?"Missing required env var"}
REPO=$CIRCLE_PROJECT_REPONAME
: ${CIRCLE_PROJECT_USERNAME?"Missing required env var"}
USER=$CIRCLE_PROJECT_USERNAME
: ${GITHUB_TOKEN?"Missing required env var"}
DEFAULT_BRANCH=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/Clever/$REPO" | jq -r '.default_branch')
echo "frontend-test failed! As a result, your deploy will not start automatically."
echo "If you think this is a transient issue, try re-running this job with the \"Rerun from failed\" option."
echo "To force deploy, do the following:"
echo "1) Create a CircleCI api token for yourself: https://circleci.com/account/api. Save it to your 1password vault."
echo "2) Run the following command, replacing CIRCLE_API_TOKEN with the token from step 1. (The colon after the token matters.)"
echo "curl -u CIRCLE_API_TOKEN: \\
-X POST \\
--header \"Content-Type: application/json\" -d '{
\"branch\": \"${DEFAULT_BRANCH}\",
\"parameters\": {
\"force_deploy\": true
}
}' https://circleci.com/api/v2/project/github/$USER/$REPO/pipeline"