File tree Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,37 @@ jobs:
134
134
: ${CIRCLE_PROJECT_REPONAME?}
135
135
136
136
commit_upm.sh ~/upm
137
+
138
+ - run :
139
+ name : Trigger zardan/ui build
140
+ command : |
141
+ set +o errexit
142
+ set +o pipefail
143
+
144
+ : ${DEPLOY_STATUS:="fail"}
145
+ : ${CIRCLE_API_KEY:=}
146
+ : ${TRIGGER_UI_USER:="zardan"}
147
+ : ${TRIGGER_UI_REPO:="ui"}
148
+ : ${TRIGGER_UI_BRANCH:="develop"}
149
+
150
+ if [[ "$DEPLOY_STATUS" != "success" ]]
151
+ then
152
+ echo "Did not deploy. Do not trigger ui build."
153
+ echo "TRIGGER_UI='idle'" >> $BASH_ENV
154
+ elif ! [[ "$CIRCLE_API_KEY" ]]
155
+ then
156
+ echo "No CircleCI API key. Can not trigger build."
157
+ echo "TRIGGER_UI='fail'" >> $BASH_ENV
158
+ else
159
+ echo "Successfully deployed. Let's go trigger ui build."
160
+ curl -X POST \
161
+ --header "Content-Type: application/json" \
162
+ --data "{
163
+ \"branch\": \"$TRIGGER_UI_BRANCH\"
164
+ }" https://circleci.com/api/v1.1/project/github/$TRIGGER_UI_USER/$TRIGGER_UI_REPO/build?circle-token=$CIRCLE_API_KEY
165
+
166
+ echo "TRIGGER_UI='success'" >> $BASH_ENV
167
+ fi
137
168
138
169
- run :
139
170
command : |
Original file line number Diff line number Diff line change 11
11
: ${DEPLOY_TAG_COMBINED:= }
12
12
: ${DEPLOY_CHANGESET:= }
13
13
: ${BUILD_STATUS:= " fail" }
14
+ : ${TRIGGER_UI:= " fail" }
14
15
15
16
if [ -z " $SLACK_WEBHOOK " ]; then
16
17
echo " NO SLACK WEBHOOK SET"
99
100
\" short\" : true
100
101
}"
101
102
103
+ if [[ " $TRIGGER_UI " == " success" ]]
104
+ then
105
+ fields=" $fields ,
106
+ {
107
+ \" value\" : \" _:heavy_check_mark: Triggered Playground UI build._\"
108
+ }"
109
+ else
110
+ fields=" $fields ,
111
+ {
112
+ \" value\" : \" _:exclamation: Failed triggering Playground UI build. Visit job for more info._\"
113
+ }"
114
+ fi
115
+
102
116
if [[ " ${GITHUB_USER_ID:- } " ]]
103
117
then
104
118
echo " Looking up commit author $GITHUB_USER_ID on github..."
Original file line number Diff line number Diff line change @@ -216,8 +216,10 @@ then
216
216
echo " Job completed successfully. Alert sent."
217
217
else
218
218
echo " Something went wrong in the webhook..."
219
+ echo " Response: $response "
219
220
fi
220
221
222
+ echo
221
223
echo " Payload:"
222
224
echo
223
225
echo " $data "
You can’t perform that action at this time.
0 commit comments