File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
cat << RUBY | ruby - r json
4
- target =
4
+ source =
5
5
if ENV [" TRAVIS_COMMIT_MESSAGE" ].to_s =~ /\A Merge pull request (#\d +) /
6
6
" #{ ENV [" TRAVIS_REPO_SLUG" ]} #{ \$1 } "
7
7
else
8
8
" #{ ENV [" TRAVIS_REPO_SLUG" ]} @#{ ENV [" TRAVIS_COMMIT" ]} (#{ ENV [" TRAVIS_BRANCH" ]} )"
9
9
end
10
+
11
+ user_name, user_email, commit_message =
12
+ ` git log -1 --pretty=format:"%aN%x00%aE%x00%B"` .split(" \0 " )
13
+
10
14
File .write(" /tmp/post.json" , {
11
15
" request" => {
12
16
" branch" => " build" ,
13
- " message" => " Deployed site for #{ target } "
17
+ " message" => " Deployed site for #{ source } " ,
18
+ " config" => {
19
+ " merge_mode" => " deep_merge" ,
20
+ " env" => {
21
+ " global" => [
22
+ " SOURCE_REPO_INFO" => source,
23
+ " SOURCE_USER_NAME" => user_name,
24
+ " SOURCE_USER_EMAIL" => user_email,
25
+ " SOURCE_COMMIT_MESSAGE" => commit_message,
26
+ ]
27
+ }
28
+ }
14
29
}
15
30
}.to_json)
16
31
RUBY
You can’t perform that action at this time.
0 commit comments