File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- body=' {
4
- "request": {
5
- "branch":"build"
3
+ cat << RUBY | ruby - r json
4
+ target =
5
+ if ENV [" TRAVIS_COMMIT_MESSAGE" ].to_s =~ /\A Merge pull request (#\d +) /
6
+ " #{ ENV [" TRAVIS_REPO_SLUG" ]} #{ \$1 } "
7
+ else
8
+ " #{ ENV [" TRAVIS_REPO_SLUG" ]} @#{ ENV [" TRAVIS_COMMIT" ]} (#{ ENV [" TRAVIS_BRANCH" ]} )"
9
+ end
10
+ File .write(" /tmp/post.json" , {
11
+ " request" => {
12
+ " branch" => " build" ,
13
+ " message" => " Deployed site for #{ target } "
6
14
}
7
- }'
15
+ }.to_json)
16
+ RUBY
8
17
9
18
curl -s -X POST \
10
19
-H " Content-Type: application/json" \
11
20
-H " Accept: application/json" \
12
21
-H " Travis-API-Version: 3" \
13
22
-H " Authorization: token $TRAVIS_TOKEN " \
14
- -d " $body " \
23
+ -d @/tmp/post.json \
15
24
https://api.travis-ci.org/repo/ManageIQ%2Fmanageiq.github.io/requests
You can’t perform that action at this time.
0 commit comments