WTBuildHelpers 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/exe/wtbuild +1 -1
- data/lib/WTBuildHelpers/version.rb +1 -1
- data/lib/jira.rb +2 -2
- metadata +2 -3
- data/lib/teamcity_git_range_fetch.rb +0 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51e1cc5730730ac7564c96bb32309baadcc7a5ca
|
4
|
+
data.tar.gz: ecb3ffe37474965c38a8de1fe724f76c076dae40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23e0fef0dfb2d2e4ca208bea7ae178c8cf81e6d8d4d862e459a6be4d268ae062827d93e715809254a935597736a4f2e06f5ad7e6803bde7928b0b7a1a8dbdc75
|
7
|
+
data.tar.gz: 4d7efd94a058780c7dc39c18f0f68c991d7cc8d9d3bae704eea9876fa3527596ee45ce839cd741e0c3c5977dede69bbc88d9076e000f6653d5e6fba3b155e290
|
data/exe/wtbuild
CHANGED
data/lib/jira.rb
CHANGED
@@ -77,7 +77,7 @@ module WTBuildHelpers::JIRA
|
|
77
77
|
args = Options.new()
|
78
78
|
|
79
79
|
opt_parser = OptionParser.new do |opts|
|
80
|
-
opts.banner = "Usage:
|
80
|
+
opts.banner = "Usage: jira_update_from_build [options]"
|
81
81
|
|
82
82
|
opts.on("-c", "--commits COMMIT_RANGE", "Specify a commit range") do |commit_range|
|
83
83
|
args.commit_range = commit_range
|
@@ -192,7 +192,7 @@ module WTBuildHelpers::JIRA
|
|
192
192
|
valid_options = true
|
193
193
|
if options.commit_range == nil
|
194
194
|
puts "Commit range is required. None specified."
|
195
|
-
puts "You can specify this in TeamCity by running '
|
195
|
+
puts "You can specify this in TeamCity by running 'teamcity_fetch_git_range' before this step." if ENV["TEAMCITY_VERSION"]
|
196
196
|
valid_options = false
|
197
197
|
end
|
198
198
|
if options.site == nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: WTBuildHelpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- WillowTreeApps
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: OptionParser
|
@@ -88,7 +88,6 @@ files:
|
|
88
88
|
- lib/help.rb
|
89
89
|
- lib/jira.rb
|
90
90
|
- lib/teamcity.rb
|
91
|
-
- lib/teamcity_git_range_fetch.rb
|
92
91
|
homepage:
|
93
92
|
licenses:
|
94
93
|
- MIT
|
@@ -1,46 +0,0 @@
|
|
1
|
-
#! /usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'base64'
|
4
|
-
require 'json'
|
5
|
-
require 'rest_client'
|
6
|
-
require 'pp'
|
7
|
-
|
8
|
-
module WTBuildHelpers
|
9
|
-
module TeamCity
|
10
|
-
def self.fetch_commit_range(teamcity_url, build_type_id, username, password)
|
11
|
-
|
12
|
-
auth = "#{username}:#{password}"
|
13
|
-
auth_token = Base64.strict_encode64(auth)
|
14
|
-
|
15
|
-
headers = { "Authorization" => "Basic #{auth_token}",
|
16
|
-
"Accept" => "application/json"
|
17
|
-
}
|
18
|
-
full_url = "#{teamcity_url}/app/rest/buildTypes/id:#{build_type_id}/builds/status:SUCCESS"
|
19
|
-
|
20
|
-
begin
|
21
|
-
response = RestClient.get(full_url, headers=headers)
|
22
|
-
json_response = JSON.parse(response.body)
|
23
|
-
rescue RestClient::Exception => e
|
24
|
-
pp e
|
25
|
-
exit
|
26
|
-
end
|
27
|
-
|
28
|
-
start_revision = ENV["BUILD_VCS_NUMBER"]
|
29
|
-
end_revision = json_response["revisions"]["revision"][0]["version"]
|
30
|
-
|
31
|
-
puts "##teamcity[setParameter name='env.TEAMCITY_COMMIT_RANGE' value='#{end_revision}..#{start_revision}']"
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
if __FILE__ == $0
|
37
|
-
if ARGV.length < 4
|
38
|
-
puts "Usage: teamcity_git_range_fetch.rb [TeamCity Url] [TeamCity Build Type Id] [TeamCity User Name] [TeamCity Password]"
|
39
|
-
puts "These parameters can be passed from TeamCity with the following line: "
|
40
|
-
puts " teamcity_git_range_fetch.rb \"%teamcity.serverUrl%\" \"%system.teamcity.buildType.id%\" \"%system.teamcity.auth.userId%\" \"%system.teamcity.auth.password%\""
|
41
|
-
|
42
|
-
exit
|
43
|
-
end
|
44
|
-
|
45
|
-
WTBuildHelpers::TeamCity.fetch_commit_range(ARGV[0], ARGV[1], ARGV[2], ARGV[3])
|
46
|
-
end
|