2
2
3
3
set -ex
4
4
5
- # Triggering jobs for a release:
6
- # - Open https://travis-ci.org/scala/scala-dist
7
- # - On the right: "More options" - "Trigger build"
8
- # - Chose the branch and enter a title for the build in the commit message filed
9
- # - Add a `before_install` custom config (see below) to set the `mode` and `version` env vars.
10
- # Using an `env: global: ...` section does not work because that overrides the default `env`
11
- # from .travis.yml. There's no way to specify the "merge mode" (*) from the web UI, that only
12
- # works in the REST API. We use `before_install` and assume it's not used otherwise.
13
- # (*) https://docs.travis-ci.com/user/triggering-builds/#Customizing-the-build-configuration
14
- # - Available modes:
15
- # - `release` to build native packages and upload them to S3
16
- # - `archive` to copy archives to chara (for scala-lang.org)
17
- # - `update-api` to update the scaladoc api symlinks
18
- # In all of the above modes, the `version` needs to be specified.
19
- #
20
- # before_install: export version=2.12.N mode=release
21
-
22
-
23
5
# Encryping files (if you need to encrypt a new file but no longer have the secret, create a new
24
6
# secret and re-encrypt all files):
25
7
#
@@ -32,7 +14,6 @@ set -ex
32
14
# 4. Decrypt the file
33
15
# openssl aes-256-cbc -d -pass "pass:$PRIV_KEY_SECRET" -in admin/files/jenkins_lightbend_chara.enc > ~/.ssh/jenkins_lightbend_chara 2>/dev/null
34
16
35
-
36
17
function ensureVersion() {
37
18
local verPat=" [0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?"
38
19
[[ " $version " =~ $verPat ]] || {
@@ -54,44 +35,39 @@ function setupSSH() {
54
35
chmod 700 ~ /.ssh && $( cd ~ /.ssh && chmod 600 config known_hosts jenkins_lightbend_chara)
55
36
}
56
37
57
- curlOut=" curlOut.txt"
58
-
59
- function checkStatus() {
60
- cat $curlOut
61
- rm -f $curlOut
62
- [[ " $1 " == " $2 " ]] || {
63
- echo " Failed to start smoketest job"
64
- exit 1
65
- }
66
- }
67
-
68
38
function triggerMsiRelease() {
69
39
local jsonTemplate=' { "accountName": "scala", "projectSlug": "scala-dist", "branch": "%s", "commitId": "%s", "environmentVariables": { "mode": "%s", "version": "%s" } }'
70
40
local json=$( printf " $jsonTemplate " " $TRAVIS_BRANCH " " $TRAVIS_COMMIT " " $mode " " $version " )
71
41
72
42
local curlStatus=$( curl \
73
- -s -o $curlOut -w " %{http_code}" \
43
+ -s -o /dev/null -w " %{http_code}" \
74
44
-H " Authorization: Bearer $APPVEYOR_TOKEN " \
75
45
-H " Content-Type: application/json" \
76
46
-d " $json " \
77
47
https://ci.appveyor.com/api/builds)
78
48
79
- checkStatus $curlStatus " 200"
49
+ [[ " $curlStatus " == " 200" ]] || {
50
+ echo " Failed to start AppVeyor build"
51
+ exit 1
52
+ }
80
53
}
81
54
82
55
function triggerSmoketest() {
83
56
local jsonTemplate=' { "request": { "branch": "%s", "message": "Smoketest %s", "config": { "before_install": "export version=%s" } } }'
84
57
local json=$( printf " $jsonTemplate " " $TRAVIS_BRANCH " " $version " " $version " )
85
58
86
59
local curlStatus=$( curl \
87
- -s -o $curlOut -w " %{http_code}" \
60
+ -s -o /dev/null -w " %{http_code}" \
88
61
-H " Travis-API-Version: 3" \
89
62
-H " Authorization: token $TRAVIS_TOKEN " \
90
63
-H " Content-Type: application/json" \
91
64
-d " $json " \
92
65
https://api.travis-ci.org/repo/scala%2Fscala-dist-smoketest/requests)
93
66
94
- checkStatus $curlStatus " 202"
67
+ [[ " $curlStatus " == " 202" ]] || {
68
+ echo " Failed to start travis build"
69
+ exit 1
70
+ }
95
71
}
96
72
97
73
if [[ " $TRAVIS_EVENT_TYPE " == " api" ]]; then
0 commit comments