jenkins-branching 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +5 -0
- data/.gemspec +56 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +66 -0
- data/README.md +4 -0
- data/Rakefile +22 -0
- data/VERSION +1 -0
- data/jenkins-branching.gemspec +59 -0
- data/lib/jenkins-branching.rb +0 -0
- data/lib/tasks/jenkins_branching.rake +242 -0
- data/test/helper.rb +18 -0
- data/test/test_jenkins-branching.rb +7 -0
- metadata +125 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 425d6979db26a1700f27a961779178807ab1a785
|
4
|
+
data.tar.gz: 563bcf65a79f94fd12bb965038d7b7bd3dd96dbe
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 721044a04d3ec462b67a9c562e3d43dcb70929dc16f47d06c2e50c2f7a6780cf135120a2db1acd91d17021f6e6b49fd43cc999affba25d9d0951fd09fd7fb795
|
7
|
+
data.tar.gz: b8f0807eb0a0492a5f69870b15f0e6ca42bed219f1fb87ecd3626049eae3aa967d767bc0473d09251364293786ceca16ce3514da02ccbf0b4a12f073a9d0292d
|
data/.document
ADDED
data/.gemspec
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: 0.1.0 ruby lib
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = nil
|
9
|
+
s.version = "0.1.0"
|
10
|
+
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.date = "2014-01-17"
|
13
|
+
s.extra_rdoc_files = [
|
14
|
+
"README.md"
|
15
|
+
]
|
16
|
+
s.files = [
|
17
|
+
".document",
|
18
|
+
"Gemfile",
|
19
|
+
"Gemfile.lock",
|
20
|
+
"README.md",
|
21
|
+
"Rakefile",
|
22
|
+
"VERSION",
|
23
|
+
"lib/jenkins-branching.rb",
|
24
|
+
"lib/tasks/jenkins_branching.rake",
|
25
|
+
"test/helper.rb",
|
26
|
+
"test/test_jenkins-branching.rb"
|
27
|
+
]
|
28
|
+
s.require_paths = ["lib"]
|
29
|
+
s.rubygems_version = "2.1.10"
|
30
|
+
s.summary = nil
|
31
|
+
|
32
|
+
if s.respond_to? :specification_version then
|
33
|
+
s.specification_version = 4
|
34
|
+
|
35
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
36
|
+
s.add_runtime_dependency(%q<rake>, [">= 0"])
|
37
|
+
s.add_runtime_dependency(%q<jenkins_api_client>, ["= 0.15.3"])
|
38
|
+
s.add_runtime_dependency(%q<highline>, [">= 0"])
|
39
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0"])
|
40
|
+
s.add_development_dependency(%q<jeweler>, ["~> 2.0.0"])
|
41
|
+
else
|
42
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
43
|
+
s.add_dependency(%q<jenkins_api_client>, ["= 0.15.3"])
|
44
|
+
s.add_dependency(%q<highline>, [">= 0"])
|
45
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
46
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.0"])
|
47
|
+
end
|
48
|
+
else
|
49
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
50
|
+
s.add_dependency(%q<jenkins_api_client>, ["= 0.15.3"])
|
51
|
+
s.add_dependency(%q<highline>, [">= 0"])
|
52
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
53
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.0"])
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
GIT
|
2
|
+
remote: git@github.com:VodafoneAustralia/jenkins_api_client.git
|
3
|
+
revision: 88c8393b72b3e9eb6de50cbad9915223d5f21392
|
4
|
+
specs:
|
5
|
+
jenkins_api_client (0.15.3)
|
6
|
+
json
|
7
|
+
mixlib-shellout (>= 1.1.0)
|
8
|
+
nokogiri (~> 1.5.0)
|
9
|
+
terminal-table (>= 1.4.0)
|
10
|
+
thor (>= 0.16.0)
|
11
|
+
|
12
|
+
GEM
|
13
|
+
remote: http://rubygems.org/
|
14
|
+
specs:
|
15
|
+
addressable (2.3.5)
|
16
|
+
builder (3.2.2)
|
17
|
+
faraday (0.8.9)
|
18
|
+
multipart-post (~> 1.2.0)
|
19
|
+
git (1.2.6)
|
20
|
+
github_api (0.10.1)
|
21
|
+
addressable
|
22
|
+
faraday (~> 0.8.1)
|
23
|
+
hashie (>= 1.2)
|
24
|
+
multi_json (~> 1.4)
|
25
|
+
nokogiri (~> 1.5.2)
|
26
|
+
oauth2
|
27
|
+
hashie (2.0.5)
|
28
|
+
highline (1.6.20)
|
29
|
+
jeweler (2.0.0)
|
30
|
+
builder
|
31
|
+
bundler (>= 1.0)
|
32
|
+
git (>= 1.2.5)
|
33
|
+
github_api
|
34
|
+
highline (>= 1.6.15)
|
35
|
+
nokogiri (>= 1.5.10)
|
36
|
+
rake
|
37
|
+
rdoc
|
38
|
+
json (1.8.1)
|
39
|
+
jwt (0.1.10)
|
40
|
+
multi_json (>= 1.5)
|
41
|
+
mixlib-shellout (1.3.0)
|
42
|
+
multi_json (1.8.4)
|
43
|
+
multi_xml (0.5.5)
|
44
|
+
multipart-post (1.2.0)
|
45
|
+
nokogiri (1.5.11)
|
46
|
+
oauth2 (0.9.3)
|
47
|
+
faraday (>= 0.8, < 0.10)
|
48
|
+
jwt (~> 0.1.8)
|
49
|
+
multi_json (~> 1.3)
|
50
|
+
multi_xml (~> 0.5)
|
51
|
+
rack (~> 1.2)
|
52
|
+
rack (1.5.2)
|
53
|
+
rake (10.1.1)
|
54
|
+
rdoc (4.0.0)
|
55
|
+
terminal-table (1.4.5)
|
56
|
+
thor (0.18.1)
|
57
|
+
|
58
|
+
PLATFORMS
|
59
|
+
ruby
|
60
|
+
|
61
|
+
DEPENDENCIES
|
62
|
+
bundler (~> 1.0)
|
63
|
+
highline
|
64
|
+
jenkins_api_client (= 0.15.3)!
|
65
|
+
jeweler (~> 2.0.0)
|
66
|
+
rake
|
data/README.md
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
gem.name = "jenkins-branching"
|
17
|
+
gem.authors = ["Bruno Chauvet"]
|
18
|
+
end
|
19
|
+
Jeweler::RubygemsDotOrgTasks.new
|
20
|
+
Jeweler::RubygemsDotOrgTasks.new
|
21
|
+
|
22
|
+
task :default => :test
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: jenkins-branching 0.1.0 ruby lib
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = "jenkins-branching"
|
9
|
+
s.version = "0.1.0"
|
10
|
+
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.authors = ["Bruno Chauvet"]
|
13
|
+
s.date = "2014-01-17"
|
14
|
+
s.extra_rdoc_files = [
|
15
|
+
"README.md"
|
16
|
+
]
|
17
|
+
s.files = [
|
18
|
+
".document",
|
19
|
+
".gemspec",
|
20
|
+
"Gemfile",
|
21
|
+
"Gemfile.lock",
|
22
|
+
"README.md",
|
23
|
+
"Rakefile",
|
24
|
+
"VERSION",
|
25
|
+
"jenkins-branching.gemspec",
|
26
|
+
"lib/jenkins-branching.rb",
|
27
|
+
"lib/tasks/jenkins_branching.rake",
|
28
|
+
"test/helper.rb",
|
29
|
+
"test/test_jenkins-branching.rb"
|
30
|
+
]
|
31
|
+
s.require_paths = ["lib"]
|
32
|
+
s.rubygems_version = "2.1.10"
|
33
|
+
s.summary = nil
|
34
|
+
|
35
|
+
if s.respond_to? :specification_version then
|
36
|
+
s.specification_version = 4
|
37
|
+
|
38
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
39
|
+
s.add_runtime_dependency(%q<rake>, [">= 0"])
|
40
|
+
s.add_runtime_dependency(%q<jenkins_api_client>, ["= 0.15.3"])
|
41
|
+
s.add_runtime_dependency(%q<highline>, [">= 0"])
|
42
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0"])
|
43
|
+
s.add_development_dependency(%q<jeweler>, ["~> 2.0.0"])
|
44
|
+
else
|
45
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
46
|
+
s.add_dependency(%q<jenkins_api_client>, ["= 0.15.3"])
|
47
|
+
s.add_dependency(%q<highline>, [">= 0"])
|
48
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
49
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.0"])
|
50
|
+
end
|
51
|
+
else
|
52
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
53
|
+
s.add_dependency(%q<jenkins_api_client>, ["= 0.15.3"])
|
54
|
+
s.add_dependency(%q<highline>, [">= 0"])
|
55
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
56
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.0"])
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
File without changes
|
@@ -0,0 +1,242 @@
|
|
1
|
+
require 'jenkins_api_client'
|
2
|
+
require 'yaml'
|
3
|
+
require 'highline/import'
|
4
|
+
|
5
|
+
namespace :jenkins do
|
6
|
+
|
7
|
+
desc 'Creates a new jenkins job for a specified branch'
|
8
|
+
task :new_job, :branch do |t, args|
|
9
|
+
Jenkins::Rake::Task.new.create_new_job args[:branch]
|
10
|
+
end
|
11
|
+
|
12
|
+
desc 'Removes a jenkins job for a specified branch'
|
13
|
+
task :delete_job, :branch do |t, args|
|
14
|
+
Jenkins::Rake::Task.new.delete_job args[:branch]
|
15
|
+
end
|
16
|
+
|
17
|
+
desc 'Fetch the current config of a job for the specified branch'
|
18
|
+
task :job_config, :branch do |t, args|
|
19
|
+
Jenkins::Rake::Task.new.get_job_config args[:branch]
|
20
|
+
end
|
21
|
+
|
22
|
+
desc 'Display config required by jenkins tasks'
|
23
|
+
task :show_config do
|
24
|
+
Jenkins::Rake::Task.new.show_config
|
25
|
+
end
|
26
|
+
|
27
|
+
desc 'Configure settings required by jenkins tasks'
|
28
|
+
task :configure do
|
29
|
+
Jenkins::Rake::Task.new.configure
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
module Jenkins
|
35
|
+
module Rake
|
36
|
+
|
37
|
+
class Task
|
38
|
+
|
39
|
+
def show_config
|
40
|
+
puts "Using configuration file: #{config_file}\n#{config}"
|
41
|
+
end
|
42
|
+
|
43
|
+
def configure
|
44
|
+
puts "Jenkins configuration for #{project}"
|
45
|
+
|
46
|
+
config['git'] = {} unless config['git']
|
47
|
+
config['git']['email'] = add_configuration(config['git']['email'], "Git email", Git::Rake::Task.get_user_email.strip)
|
48
|
+
|
49
|
+
config['jenkins'] = {} unless config['jenkins']
|
50
|
+
config['jenkins']['url'] = add_configuration(config['jenkins']['url'], "Jenkins URL", "https://10.48.0.91")
|
51
|
+
config['jenkins']['ssl'] = add_configuration(config['jenkins']['ssl'], "Use SSL", "true")
|
52
|
+
config['jenkins']['proxy_ip'] = add_configuration(config['jenkins']['proxy_ip'], "Proxy IP", "localhost")
|
53
|
+
config['jenkins']['proxy_port'] = add_configuration(config['jenkins']['proxy_port'], "Proxy port", "3128")
|
54
|
+
config['jenkins']['username'] = add_configuration(config['jenkins']['username'], "Jenkins Username", "")
|
55
|
+
config['jenkins']['password'] = add_configuration(config['jenkins']['password'], "Jenkins Password", "", false)
|
56
|
+
config['jenkins']['restricted_node'] = add_configuration(config['jenkins']['restricted_node'], "Jenkins node", "PaaS-Jenkins-Slave")
|
57
|
+
config['jenkins']['job_prefix'] = add_configuration(config['jenkins']['job_prefix'], "Jonb prefix", "search-test")
|
58
|
+
|
59
|
+
config['s3_options'] = {} unless config['s3_options']
|
60
|
+
config['s3_options']['profile'] = add_configuration(config['s3_options']['profile'], "S3 Profile", "JenkinsUser")
|
61
|
+
config['s3_options']['bucket'] = add_configuration(config['s3_options']['bucket'], "S3 Bucket", "vha-repository")
|
62
|
+
config['s3_options']['region'] = add_configuration(config['s3_options']['region'], "S3 Region", "AP_SOUTHEAST_2")
|
63
|
+
|
64
|
+
File.open("#{config_file}", "w") do |file|
|
65
|
+
file.write config.to_yaml
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
def create_new_job(branch)
|
71
|
+
configure unless config
|
72
|
+
|
73
|
+
job_name = job(branch)
|
74
|
+
puts "Creating new job #{job_name}"
|
75
|
+
|
76
|
+
fail_on_args_error(branch)
|
77
|
+
fail_on_missing_remote_branch(branch)
|
78
|
+
fail_on_existing_job(job_name)
|
79
|
+
|
80
|
+
rake_spec = "\nbundle exec rake spec"
|
81
|
+
rake_jasmine = " && bundle exec rake jasmine"
|
82
|
+
rake_cukes = " && bundle exec rake cukes"
|
83
|
+
tar_file_name = "#{project}-#{branch}-${BUILD_NUMBER}.tar.gz"
|
84
|
+
tar_file = "&& tar cvfz #{tar_file_name} --exclude-from=tarignore * .[a-zA-Z0-9]*"
|
85
|
+
job_hash = {
|
86
|
+
:name => job_name,
|
87
|
+
:restricted_node => "#{config['jenkins']['restricted_node']}",
|
88
|
+
:scm_provider => "git",
|
89
|
+
:scm_url => "git@github.com:VodafoneAustralia/#{project}.git",
|
90
|
+
:scm_branch => branch,
|
91
|
+
:shell_command => "#!/bin/bash -e\n\nsource ~/.bash_profile\nsource /etc/profile.d/chruby.sh && chruby 2.0.0\nbundle package --all\nbundle install\n
|
92
|
+
echo SS_VERSION=#{branch}-\$\{BUILD_NUMBER\} > #{project}.manifest
|
93
|
+
LAST_COMMIT=$(git rev-parse HEAD)
|
94
|
+
echo GIT_VERSION=\$\{LAST_COMMIT\} >> #{project}.manifest
|
95
|
+
#{rake_spec}#{rake_jasmine}#{rake_cukes}#{tar_file}",
|
96
|
+
:scm_branch => branch,
|
97
|
+
:scm_trigger => '*/5 * * * *',
|
98
|
+
:build_wrappers_xvfb => true,
|
99
|
+
:build_wrappers_ansicolor => true,
|
100
|
+
:log_rotator => true
|
101
|
+
}
|
102
|
+
|
103
|
+
s3_options = config['s3_options'].merge({tar_file: tar_file_name})
|
104
|
+
git_options = { fast_remote_polling: true }
|
105
|
+
job_hash.merge!(s3_artifact_publisher: s3_options, git: git_options)
|
106
|
+
client.job.create_freestyle job_hash
|
107
|
+
|
108
|
+
add_email_notification(job_name)
|
109
|
+
|
110
|
+
puts "Done. New job #{job_name} created with SUCCESS"
|
111
|
+
end
|
112
|
+
|
113
|
+
def delete_job(branch)
|
114
|
+
job_name = job(branch)
|
115
|
+
puts "Deleting job #{job_name}"
|
116
|
+
|
117
|
+
fail_on_args_error(branch)
|
118
|
+
fail_on_missing_remote_branch(branch)
|
119
|
+
fail_on_non_existing_job(job_name)
|
120
|
+
|
121
|
+
client.job.delete job_name
|
122
|
+
|
123
|
+
puts "Done. Job #{job_name} has been deleted"
|
124
|
+
end
|
125
|
+
|
126
|
+
def get_job_config(branch)
|
127
|
+
job_name = job(branch)
|
128
|
+
puts "Fetching configuration of job: #{job_name}"
|
129
|
+
|
130
|
+
fail_on_args_error(branch)
|
131
|
+
fail_on_missing_remote_branch(branch)
|
132
|
+
fail_on_non_existing_job(job_name)
|
133
|
+
|
134
|
+
puts "Done.\n#{client.job.get_config(job_name)}"
|
135
|
+
end
|
136
|
+
|
137
|
+
private
|
138
|
+
|
139
|
+
def client
|
140
|
+
@client ||= begin
|
141
|
+
server_url = config['jenkins']['url']
|
142
|
+
proxy_ip = config['jenkins']['proxy_ip']
|
143
|
+
proxy_port = config['jenkins']['proxy_port']
|
144
|
+
|
145
|
+
if proxy_ip.to_s == ''
|
146
|
+
puts "Connecting to Jenkins server #{server_url}"
|
147
|
+
JenkinsApi::Client.new(
|
148
|
+
:server_url => server_url,
|
149
|
+
:username => config['jenkins']['username'],
|
150
|
+
:password => config['jenkins']['password'],
|
151
|
+
:ssl => config['jenkins']['ssl'],
|
152
|
+
:timeout => 300,
|
153
|
+
:log_level => Logger::DEBUG
|
154
|
+
)
|
155
|
+
else
|
156
|
+
puts "Connecting to Jenkins server #{server_url} via proxy #{proxy_ip}:#{proxy_port}"
|
157
|
+
JenkinsApi::Client.new(
|
158
|
+
:server_url => server_url,
|
159
|
+
:username => config['jenkins']['username'],
|
160
|
+
:password => config['jenkins']['password'],
|
161
|
+
:ssl => config['jenkins']['ssl'],
|
162
|
+
:timeout => 300,
|
163
|
+
:proxy_ip => proxy_ip,
|
164
|
+
:proxy_port => proxy_port,
|
165
|
+
:log_level => Logger::DEBUG
|
166
|
+
)
|
167
|
+
end
|
168
|
+
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
def add_email_notification(job_name)
|
173
|
+
user_email_address = config['git']['email']
|
174
|
+
unless user_email_address.empty?
|
175
|
+
client.job.add_email_notification(:name => job_name, :notification_email => user_email_address)
|
176
|
+
puts "Build failures will be emailed to #{user_email_address}"
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
def config
|
181
|
+
@config ||= YAML::load(File.open(config_file))
|
182
|
+
end
|
183
|
+
|
184
|
+
def config_file
|
185
|
+
dirname = File.dirname("#{ENV['HOME']}/.#{project}/#{project}.yml")
|
186
|
+
Dir.mkdir(dirname) unless Dir.exist?(dirname)
|
187
|
+
@config_file ||= "#{dirname}/#{project}.yml"
|
188
|
+
end
|
189
|
+
|
190
|
+
def add_configuration(current_value, label, default, echo=true)
|
191
|
+
current_value = default if current_value.to_s == ''
|
192
|
+
value = (ask("#{label} (#{echo ? current_value : '******'}): ") { |q| q.echo = echo }).to_s
|
193
|
+
return value.empty? ? current_value : value
|
194
|
+
end
|
195
|
+
|
196
|
+
def fail_on_args_error(branch)
|
197
|
+
fail 'Please specify a branch name, e.g. rake jenkins:new_job[SS-123]' if branch.to_s == ''
|
198
|
+
end
|
199
|
+
|
200
|
+
def fail_on_missing_remote_branch(branch)
|
201
|
+
fail "No remote branch found named #{branch}, please create one first" unless Git::Rake::Task.remote_branch_exists?(branch)
|
202
|
+
end
|
203
|
+
|
204
|
+
def fail_on_existing_job(job)
|
205
|
+
fail "Job #{job} already exists, please provide a unique job name" if client.job.exists?(job)
|
206
|
+
end
|
207
|
+
|
208
|
+
def fail_on_non_existing_job(job)
|
209
|
+
fail "Job #{job} does not exist" unless client.job.exists?(job)
|
210
|
+
end
|
211
|
+
|
212
|
+
def project
|
213
|
+
@project ||= File.basename(Dir.getwd)
|
214
|
+
end
|
215
|
+
|
216
|
+
def job(branch)
|
217
|
+
@job ||= "#{config['jenkins']['job_prefix']}-#{project}-#{branch}"
|
218
|
+
end
|
219
|
+
|
220
|
+
end
|
221
|
+
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
|
226
|
+
module Git
|
227
|
+
module Rake
|
228
|
+
|
229
|
+
class Task
|
230
|
+
|
231
|
+
def self.get_user_email
|
232
|
+
`git config --get user.email`
|
233
|
+
end
|
234
|
+
|
235
|
+
def self.remote_branch_exists?(branch)
|
236
|
+
`git branch -r`.each_line.count {|l| l.include?(branch)} > 0
|
237
|
+
end
|
238
|
+
|
239
|
+
end
|
240
|
+
|
241
|
+
end
|
242
|
+
end
|
data/test/helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'test/unit'
|
11
|
+
require 'shoulda'
|
12
|
+
|
13
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
14
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
15
|
+
require 'jenkins-branching'
|
16
|
+
|
17
|
+
class Test::Unit::TestCase
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jenkins-branching
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Bruno Chauvet
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-01-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: jenkins_api_client
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.15.3
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.15.3
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: highline
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: jeweler
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 2.0.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 2.0.0
|
83
|
+
description:
|
84
|
+
email:
|
85
|
+
executables: []
|
86
|
+
extensions: []
|
87
|
+
extra_rdoc_files:
|
88
|
+
- README.md
|
89
|
+
files:
|
90
|
+
- .document
|
91
|
+
- .gemspec
|
92
|
+
- Gemfile
|
93
|
+
- Gemfile.lock
|
94
|
+
- README.md
|
95
|
+
- Rakefile
|
96
|
+
- VERSION
|
97
|
+
- jenkins-branching.gemspec
|
98
|
+
- lib/jenkins-branching.rb
|
99
|
+
- lib/tasks/jenkins_branching.rake
|
100
|
+
- test/helper.rb
|
101
|
+
- test/test_jenkins-branching.rb
|
102
|
+
homepage:
|
103
|
+
licenses: []
|
104
|
+
metadata: {}
|
105
|
+
post_install_message:
|
106
|
+
rdoc_options: []
|
107
|
+
require_paths:
|
108
|
+
- lib
|
109
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - '>='
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0'
|
114
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - '>='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
requirements: []
|
120
|
+
rubyforge_project:
|
121
|
+
rubygems_version: 2.1.10
|
122
|
+
signing_key:
|
123
|
+
specification_version: 4
|
124
|
+
summary: ''
|
125
|
+
test_files: []
|