@@ -60,26 +60,44 @@ function setupS3() {
60
60
echo " setup s3"
61
61
}
62
62
63
+ curlOut=" curlOut.txt"
64
+
65
+ function checkStatus() {
66
+ cat $curlOut
67
+ rm -f $curlOut
68
+ [[ " $1 " == " $2 " ]] || {
69
+ echo " Failed to start smoketest job"
70
+ exit 1
71
+ }
72
+ }
73
+
63
74
function triggerMsiRelease() {
64
75
local jsonTemplate=' { "accountName": "scala", "projectSlug": "scala-dist", "branch": "%s", "commitId": "%s", "environmentVariables": { "mode": "%s", "version": "%s" } }'
65
76
local json=$( printf " $jsonTemplate " " $TRAVIS_BRANCH " " $TRAVIS_COMMIT " " $mode " " $version " )
66
- curl \
77
+
78
+ local curlStatus=$( curl \
79
+ -s -o $curlOut -w " %{http_code}" \
67
80
-H " Authorization: Bearer $APPVEYOR_TOKEN " \
68
81
-H " Content-Type: application/json" \
69
82
-d " $json " \
70
- https://ci.appveyor.com/api/builds
83
+ https://ci.appveyor.com/api/builds)
84
+
85
+ checkStatus $curlStatus " 200"
71
86
}
72
87
73
88
function triggerSmoketest() {
74
89
local jsonTemplate=' { "request": { "branch": "%s", "message": "Smoketest %s", "config": { "before_install": "export version=%s" } } }'
75
90
local json=$( printf " $jsonTemplate " " $TRAVIS_BRANCH " " $version " " $version " )
76
91
77
- curl \
92
+ local curlStatus=$( curl \
93
+ -s -o $curlOut -w " %{http_code}" \
78
94
-H " Travis-API-Version: 3" \
79
95
-H " Authorization: token $TRAVIS_TOKEN " \
80
96
-H " Content-Type: application/json" \
81
97
-d " $json " \
82
- https://api.travis-ci.org/repo/scala%2Fscala-dist-smoketest/requests
98
+ https://api.travis-ci.org/repo/scala%2Fscala-dist-smoketest/requests)
99
+
100
+ checkStatus $curlStatus " 202"
83
101
}
84
102
85
103
if [[ " $TRAVIS_EVENT_TYPE " == " api" ]]; then
0 commit comments