jenkins_pipeline_builder 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWE4MTc4M2I3NTdlOGI5MDVmYWE5Mjc1YjkwYTczNjljZGQyNzlmMw==
4
+ YTBmZTQxZjFjZWJiZWFjNzU3NGNkN2QyN2IxYzRkMjk1NTk5NGVjOQ==
5
5
  data.tar.gz: !binary |-
6
- OTQ4OTI0NTIxMjJjYWRiODI4ZDczNjZkYzFkMzQzNTQyM2QzMTEwMA==
6
+ NWRiODQ0NjcxM2FhN2RmMTMxOTA5OWJkMDhlZTM5MTk5ZjE5MTFlYg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MmM2N2FiMGViNjlmOGZjYTFiMTA1Y2I4MDJkMTg1MGQ4ODc4YmE4N2JmNjIx
10
- NWZmZDkyNjFhY2E2MDQwM2RlNzRhMmNiNTdiODIwNzA5MzFlOWU0NmRkYWQ5
11
- NmUyM2ExZTY2YWUwNWUwZjE1NDAwMmEzZDE5MGRlNjhjNThjYjU=
9
+ MmQxYjY5MGZjZDY5OTBkMTM1NThjNjMwMzI2OWUzNzQ1ZjQ1M2I1MmZjMmM0
10
+ NWFkZjhkZTNlOThkODRlM2UwN2YyMTg2MTE4ZmJiYmVlOTk2MWIwYjBhNTAy
11
+ MmZiZjYwMzAzYzRiNTI4ZmVkOTM1OTkwMTU1ZWIwZGZhNWMxNTk=
12
12
  data.tar.gz: !binary |-
13
- NTA2ZjJmY2Y3NzdjYjc0NjJjMmMzMGVjZTg1NzEyNjYzZGYwMzlkZDEwOTA0
14
- ZGZiODg2NTg3OTE4OTNkNjM2N2M4YWYyYjFjNThlYTA3ZjljZTg3N2JmMTMz
15
- ZTIxN2QyZDE1NmMwNjdhNjE1YTFjOTdkN2U0Yzc0NDBiY2FhOTE=
13
+ ODM3MjA5MWQ5NDYyNTUwMmI2ZDVlMTA5NzYwMGM2OTkxNzVhOWRlYjQ0MWQ2
14
+ Y2FkNDZiYmUzNzJiYjEyMWY5NWJhMWZlMTliZGYyZDc1MTdkZTI2ZjIxMWJh
15
+ NTAyYmE5N2RmODA5MTVmMWVjMTZkOTQxNTc5NmNhYjAyMmQzZGU=
data/README.md CHANGED
@@ -294,7 +294,7 @@ You need to manually create your promotion rules. Using this plugin will help yo
294
294
  The pull request generator will generate pipelines for pull requests that are noticed on your repo. It will also remove old pipelines from Jenkins if the pull_request is closed.
295
295
  If you need to modify job parameters please just specify that in the jobs section like the example below.
296
296
 
297
- When running a project through this module, the project {{name}} is appended with "-PR##" where ## is the number of the pull request.
297
+ When running a project through this module, the project {{name}} is appended with "-PR##" where ## is the number of the pull request. You can also use {{pull_request_number}} to get just the number of the PR.
298
298
 
299
299
  ```yaml
300
300
  - job:
@@ -200,7 +200,15 @@ job_attribute do
200
200
 
201
201
  send('jenkins.plugins.hipchat.HipChatNotifier_-HipChatJobProperty') do
202
202
  room params[:room]
203
- startNotification params[:'start-notify'] || false
203
+ # :'start-notify' is legacy and evil, but I don't want anyone complaining
204
+ startNotification params[:start_notify] || params[:'start-notify'] || false
205
+ startNotification params[:start_notify] || false
206
+ notifySuccess params[:success_notify] || true
207
+ notifyFailure params[:failure_notify] || true
208
+ notifyBackToNormal params[:normal_notify] || true
209
+ notifyAborted params[:aborted_notify] || true
210
+ notifyNotBuilt params[:notbuilt_notify] || false
211
+ notifyUnstable params[:unstable_notify] || true
204
212
  end
205
213
  end
206
214
  end
@@ -92,6 +92,7 @@ module JenkinsPipelineBuilder
92
92
  @number = number
93
93
  @jobs = Marshal.load(Marshal.dump(jobs))
94
94
  @generator = Marshal.load(Marshal.dump(generator))
95
+ @project[:value][:pull_request_number] = "#{@number}"
95
96
 
96
97
  # Run
97
98
  run!
@@ -21,5 +21,5 @@
21
21
  #
22
22
 
23
23
  module JenkinsPipelineBuilder
24
- VERSION = '0.9.3'
24
+ VERSION = '0.9.4'
25
25
  end
@@ -5,7 +5,7 @@ describe JenkinsPipelineBuilder::PullRequestGenerator do
5
5
  let(:pull_request_generator) { JenkinsPipelineBuilder::PullRequestGenerator }
6
6
  let(:project) { { name: 'pull_req_test', type: :project, value: { name: 'pull_req_test', jobs: ['{{name}}-00', '{{name}}-10', '{{name}}-11'] } } }
7
7
  let(:jobs) { { '{{name}}-10' => { name: '{{name}}-10', type: :'job-template', value: { name: '{{name}}-10', description: '{{description}}', publishers: [{ downstream: { project: '{{job@{{name}}-11}}' } }] } }, '{{name}}-11' => { name: '{{name}}-11', type: :'job-template', value: { name: '{{name}}-11', description: '{{description}}' } } } }
8
- let(:create_jobs) { [{ name: 'pull_req_test-PR5', type: :project, value: { name: 'pull_req_test-PR5', jobs: ['{{name}}-10', '{{name}}-11'] } }, { name: 'pull_req_test-PR6', type: :project, value: { name: 'pull_req_test-PR6', jobs: ['{{name}}-10', '{{name}}-11'] } }] }
8
+ let(:create_jobs) { [{ name: 'pull_req_test-PR5', type: :project, value: { name: 'pull_req_test-PR5', jobs: ['{{name}}-10', '{{name}}-11'], pull_request_number: '5' } }, { name: 'pull_req_test-PR6', type: :project, value: { name: 'pull_req_test-PR6', jobs: ['{{name}}-10', '{{name}}-11'], pull_request_number: '6' } }] }
9
9
  let(:pull_request) { { name: '{{name}}-00', type: :job, name: '{{name}}-00', job_type: 'pull_request_generator', git_url: 'https://www.github.com/', git_repo: 'jenkins_pipeline_builder', git_org: 'constantcontact', jobs: ['{{name}}-10', '{{name}}-11'], builders: [{ shell_command: 'generate -v || gem install jenkins_pipeline_builder\ngenerate pipeline -c config/{{login_config}} pull_request pipeline/ {{name}}\n' }] } }
10
10
  before do
11
11
  # Request to get current pull requests from github
@@ -38,7 +38,7 @@ describe JenkinsPipelineBuilder::PullRequest do
38
38
  it 'process pull_request' do
39
39
  pull = pull_request_class.new(project, 2, jobs, pull_request)
40
40
  post_jobs = { '{{name}}-10' => { name: '{{name}}-10', type: :'job-template', value: { name: '{{name}}-10', description: '{{description}}', publishers: [{ downstream: { project: '{{job@{{name}}-11}}' } }], scm_branch: 'origin/pr/2/head', scm_params: { refspec: 'refs/pull/*:refs/remotes/origin/pr/*' } } }, '{{name}}-11' => { name: '{{name}}-11', type: :'job-template', value: { name: '{{name}}-11', description: '{{description}}', scm_branch: 'origin/pr/2/head', scm_params: { refspec: 'refs/pull/*:refs/remotes/origin/pr/*' } } } }
41
- post_project = { name: 'pull_req_test-PR2', type: :project, value: { name: 'pull_req_test-PR2', jobs: ['{{name}}-00', '{{name}}-10', '{{name}}-11'] } }
41
+ post_project = { name: 'pull_req_test-PR2', type: :project, value: { name: 'pull_req_test-PR2', jobs: ['{{name}}-00', '{{name}}-10', '{{name}}-11'], pull_request_number: '2' } }
42
42
 
43
43
  expect(pull.project).to eq(post_project)
44
44
  expect(pull.jobs).to eq(post_jobs)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jenkins_pipeline_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Moochnick
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-14 00:00:00.000000000 Z
12
+ date: 2014-11-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri