autoproj-jenkins 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e49b6103056732ceec497949e398860b7440f301
4
- data.tar.gz: 1e8b1caeb82b4c19e269950a697ce8c759ca9013
3
+ metadata.gz: a99e744847ba8cfabd0e714c65dc7d6a6687eac4
4
+ data.tar.gz: 877ed75c92c1df0124a75cb5035b740a681672a0
5
5
  SHA512:
6
- metadata.gz: b1f67ea6b8ec14662ef56b7801e9eaa8d4f6250b9c9bcfecf45fc622a0219fbb89e0af6e8106e17e4f7fe9675fa8b9cd5c74f56815c68518ad9b3fc440e602e7
7
- data.tar.gz: 1dede042a4c91c8d73659cca3b37f2c69ad00a2510d76aa3a4aa0eb295e5f3d12f95067703bf0b7494db7a8c7f729bd2c5dd98aa10e76b214c77098204233496
6
+ metadata.gz: 7935345cd7e706ef5e57024994284263ac89243b89831df79e3dbb4c9bcaecf62bc641695e81e868a49b80170cef2b4e6dc2f08c8a96e7216b60aa9175bd53f5
7
+ data.tar.gz: 4a93f5d6394cd1ce958fec195a408adb7e9ffe72fd4d3c268028be8a41be53f61ff209c8f6f329c7a428e2bd4be507d45bd4db86965c7ad38c14761949580286
@@ -1,4 +1,3 @@
1
- def fullWorkspaceDir = pwd()
2
1
  env.HOME = fullWorkspaceDir
3
2
  <% if autoproj_install_path %>
4
3
  sh 'cp -f "<%= autoproj_install_path %>" ./autoproj_install'
@@ -23,5 +22,4 @@ dir('dev') {
23
22
  sh ".autoproj/bin/aup autoproj/ --force-reset"
24
23
  }
25
24
 
26
- def autoproj = "${fullWorkspaceDir}/dev/.autoproj/bin/autoproj"
27
25
  env.AUTOPROJ_CURRENT_ROOT = "${fullWorkspaceDir}/dev"
@@ -9,4 +9,5 @@ USE_OCL: false
9
9
  rtt_target: gnulinux
10
10
  rtt_corba_implementation: omniorb
11
11
  autoproj_test_utility_default: true
12
+ import_log_enabled: false
12
13
  <%= ::YAML.dump('manifest_source' => vcs.to_hash).gsub(/^---\s*/, '') %>
@@ -1,43 +1,51 @@
1
+ <%= render_template('library.pipeline') %>
2
+
1
3
  node(label: 'autoproj-jenkins') {
2
- stage 'bootstrap'
3
- <%= render_template('bootstrap.pipeline', vcs: vcs, gemfile: gemfile, autoproj_install_path: autoproj_install_path, vcs_credentials: vcs_credentials, indent: 4) %>
4
+ def fullWorkspaceDir = pwd()
5
+ def autoproj = "${fullWorkspaceDir}/dev/.autoproj/bin/autoproj"
6
+
7
+ stage('bootstrap') {
8
+ <%= render_template('bootstrap.pipeline', vcs: vcs, gemfile: gemfile, autoproj_install_path: autoproj_install_path, vcs_credentials: vcs_credentials, indent: 4) %>
9
+ }
4
10
 
5
11
  dir('dev') {
6
12
  def arg_packages = "<%= package_names.map { |name| "'#{name}'" }.join(" ") %>"
7
13
 
8
- stage 'checkout and update packages'
9
- sh "${autoproj} test enable"
10
- <%= render_template('setup-git-credentials.pipeline', credentials: vcs_credentials[:git], indent: 8) %>
11
- sh "${autoproj} update ${arg_packages} --force-reset -k"
12
-
13
- stage 'update package jobs and trigger them'
14
- def arg_dev = "<%= " --dev" if dev %>"
15
- def arg_job_prefix = "<%= " '--job-prefix=#{job_prefix}'" if !job_prefix.empty? %>"
16
- <% if vcs_credentials.empty? %>
17
- def arg_vcs_credentials = ""
18
- <% else %>
19
- <% arg_vcs_credentials = vcs_credentials.credentials.flat_map do |vcs_type, vcs_c|
20
- vcs_c.map do |c|
21
- "#{vcs_type}:#{c.protocol}://#{c.host}"
22
- end
23
- end.join(" ") %>
24
- def arg_vcs_credentials = " '--vcs-credentials=<%= arg_vcs_credentials %>'"
25
- <% end %>
26
-
27
- <% if credentials_id %>
28
- def jobNames = withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: '<%= credentials_id %>',
29
- usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {
30
- def credentials = " --username '${env.USERNAME}' --password '${env.PASSWORD}'"
31
- sh(script: "${autoproj} jenkins update${arg_dev}${arg_job_prefix} '${env.JENKINS_URL}' ${arg_packages}${credentials}${arg_vcs_credentials}", returnStdout: true).split("\n")
14
+ stage('checkout and update packages') {
15
+ sh "${autoproj} test enable"
16
+ <%= render_template('setup-git-credentials.pipeline', credentials: vcs_credentials[:git], indent: 8) %>
17
+ sh "${autoproj} update ${arg_packages} --force-reset -k"
32
18
  }
33
- <% else %>
34
- def jobNames = sh(
35
- script: "${autoproj} jenkins update${arg_dev}${arg_job_prefix} 'http://localhost:8080' ${arg_packages}${arg_vcs_credentials}",
36
- returnStdout: true).split("\n")
37
- <% end %>
38
- for (job_name in jobNames) {
39
- build job: job_name, wait: false
19
+
20
+ def jobNames = []
21
+
22
+ stage('update package jobs and trigger them') {
23
+ def arg_dev = "<%= " --dev" if dev %>"
24
+ def arg_job_prefix = "<%= " '--job-prefix=#{job_prefix}'" if !job_prefix.empty? %>"
25
+ <% if vcs_credentials.empty? %>
26
+ def arg_vcs_credentials = ""
27
+ <% else %>
28
+ <% arg_vcs_credentials = vcs_credentials.credentials.flat_map do |vcs_type, vcs_c|
29
+ vcs_c.map do |c|
30
+ "#{vcs_type}:#{c.protocol}://#{c.host}"
31
+ end
32
+ end.join(" ") %>
33
+ def arg_vcs_credentials = " '--vcs-credentials=<%= arg_vcs_credentials %>'"
34
+ <% end %>
35
+
36
+ <% if credentials_id %>
37
+ jobNames = withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: '<%= credentials_id %>',
38
+ usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {
39
+ def credentials = " --username '${env.USERNAME}' --password '${env.PASSWORD}'"
40
+ sh(script: "${autoproj} jenkins update${arg_dev}${arg_job_prefix} '${env.JENKINS_URL}' ${arg_packages}${credentials}${arg_vcs_credentials}", returnStdout: true).split("\n")
41
+ }
42
+ <% else %>
43
+ jobNames = sh(
44
+ script: "${autoproj} jenkins update${arg_dev}${arg_job_prefix} 'http://localhost:8080' ${arg_packages}${arg_vcs_credentials}",
45
+ returnStdout: true).split("\n")
46
+ <% end %>
40
47
  }
48
+ triggerDownstreamJobs(jobNames)
41
49
  }
42
50
  }
43
51
 
@@ -1,3 +1,4 @@
1
+ @NonCPS
1
2
  def isUpstreamOK(jobName, buildId)
2
3
  {
3
4
  def job = Jenkins.instance.getItem(jobName)
@@ -26,19 +27,23 @@ def isUpstreamOK(jobName, buildId)
26
27
  }
27
28
  }
28
29
 
30
+ @NonCPS
29
31
  def getTriggerBuild(currentBuild)
30
32
  {
31
33
  def triggerBuild = currentBuild.rawBuild.getCause(hudson.model.Cause$UpstreamCause)
32
34
  if (triggerBuild) {
33
35
  return [triggerBuild.getUpstreamProject(), triggerBuild.getUpstreamBuild()]
34
36
  }
37
+ return null
35
38
  }
36
39
 
40
+ @NonCPS
37
41
  def findBuildTriggeredBy(job, triggerJob, triggerBuild)
38
42
  {
39
43
  def jobBuilds = job.getBuilds()
40
- for (build in jobBuilds)
44
+ for (buildIndex = 0; buildIndex < jobBuilds.size(); ++buildIndex)
41
45
  {
46
+ def build = jobBuilds[buildIndex]
42
47
  def buildCause = build.getCause(hudson.model.Cause$UpstreamCause)
43
48
  if (buildCause)
44
49
  {
@@ -50,6 +55,7 @@ def findBuildTriggeredBy(job, triggerJob, triggerBuild)
50
55
  }
51
56
  }
52
57
  }
58
+ return null
53
59
  }
54
60
 
55
61
  def getUpstreamBuilds(upstreamJobNames, triggerJob, triggerBuild)
@@ -57,8 +63,9 @@ def getUpstreamBuilds(upstreamJobNames, triggerJob, triggerBuild)
57
63
  def upstreamBuilds = []
58
64
 
59
65
  // Iterate list -- NOTE: we cannot use groovy style or even modern java style iteration
60
- for (jobName in upstreamJobNames)
66
+ for (jobIndex = 0; jobIndex < upstreamJobNames.size(); ++jobIndex)
61
67
  {
68
+ def jobName = upstreamJobNames[jobIndex]
62
69
  if (jobName == triggerJob)
63
70
  {
64
71
  echo "upstream build: ${jobName}#${triggerBuild}"
@@ -93,7 +100,9 @@ def waitForUpstreamBuilds(upstreamBuilds)
93
100
  waitContinue = false;
94
101
 
95
102
  // Iterate list -- NOTE: we cannot use groovy style or even modern java style iteration
96
- for(entry in upstreamBuilds) {
103
+ for (upstreamBuildIndex = 0; upstreamBuildIndex < upstreamBuilds.size(); ++upstreamBuildIndex)
104
+ {
105
+ def entry = upstreamBuilds[upstreamBuildIndex]
97
106
  def upstreamJobName = entry[0]
98
107
  def upstreamBuildId = entry[1]
99
108
  def status = isUpstreamOK(upstreamJobName, upstreamBuildId)
@@ -122,7 +131,8 @@ def makeUpstreamArtifactImporters(autoproj, fullWorkspaceDir, upstreamDir,
122
131
  dir(upstreamDir) { deleteDir() }
123
132
 
124
133
  def upstreamArtifactImporters = [:]
125
- for (jobIndex = 0; jobIndex < upstreamJobNames.size(); ++jobIndex) {
134
+ for (jobIndex = 0; jobIndex < upstreamJobNames.size(); ++jobIndex)
135
+ {
126
136
  def jobName = upstreamJobNames[jobIndex]
127
137
  def fullPrefix = upstreamPrefixes[jobIndex]
128
138
  def buildId = upstreamBuilds[jobIndex][1]
@@ -147,14 +157,49 @@ def makeUpstreamArtifactImporters(autoproj, fullWorkspaceDir, upstreamDir,
147
157
  return upstreamArtifactImporters
148
158
  }
149
159
 
150
- def triggeredByUser = (currentBuild.rawBuild.getCause(hudson.model.Cause$UserIdCause) != null)
151
- def triggerBuild = getTriggerBuild(currentBuild)
152
- if (!triggerBuild) {
153
- triggerBuild = [null, null]
160
+ def installUpstreamArtifacts(autoproj, fullWorkspaceDir,
161
+ jobPackageName, jobPackagePrefix,
162
+ upstreamJobNames, upstreamPackagePrefixes, upstreamBuilds)
163
+ {
164
+ def upstreamDir = "artifacts/upstream"
165
+ parallel(makeUpstreamArtifactImporters(
166
+ autoproj, fullWorkspaceDir, upstreamDir,
167
+ upstreamJobNames, upstreamPackagePrefixes, upstreamBuilds)
168
+ )
169
+ // We don't need the upstream artifacts anymore, clear some disk space
170
+ dir(upstreamDir) { deleteDir() }
171
+
172
+ if (fileExists("lastPrefix")) {
173
+ sh "mv lastPrefix '${jobPackagePrefix}'"
174
+ }
175
+ return null
154
176
  }
155
- def upstreamBuilds = getUpstreamBuilds(upstreamJobNames, triggerBuild[0], triggerBuild[1])
156
177
 
157
- if (!waitForUpstreamBuilds(upstreamBuilds)) {
158
- return
178
+ def handleDownstream(autoproj, fullWorkspaceDir,
179
+ jobName, jobPackagePrefix, artifactGlob)
180
+ {
181
+ def downstreamDir = "artifacts/downstream"
182
+ def targetArtifactPath = "${fullWorkspaceDir}/${downstreamDir}/${jobName}-prefix.zip"
183
+
184
+ dir(downstreamDir) { deleteDir() }
185
+ dir("${downstreamDir}/${jobName}") {
186
+ sh "rsync '${jobPackagePrefix}/' './' -a --delete"
187
+ sh "${autoproj} jenkins relativize ./ '${fullWorkspaceDir}' '@WORKSPACE_ROOT@'"
188
+ zip zipFile: targetArtifactPath, glob: artifactGlob
189
+ }
190
+ dir(downstreamDir) {
191
+ archiveArtifacts artifacts: "*.zip"
192
+ deleteDir()
193
+ }
194
+ return null
195
+ }
196
+
197
+
198
+ def triggerDownstreamJobs(jobNames) {
199
+ for (jobIndex = 0; jobIndex < jobNames.size(); ++jobIndex)
200
+ {
201
+ build job: jobNames[jobIndex], wait: false
202
+ }
203
+ return null
159
204
  }
160
205
 
@@ -1,96 +1,115 @@
1
1
  import java.nio.file.Paths
2
2
 
3
+ def jobName = "<%= job_name %>"
3
4
  def jobPackageName = "<%= package_name %>"
4
5
  def upstreamJobNames = [<%= upstream_jobs.each_key.map { |job_name| "'#{job_name}'" }.join(", ") %>]
5
6
  def upstreamPackageNames = [<%= upstream_jobs.each_value.map { |package_name| "'#{package_name}'" }.join(", ") %>]
7
+ <%= render_template('library.pipeline') %>
8
+ def triggeredByUpstream = false
9
+ def upstreamBuilds = []
10
+
11
+ stage('waiting for upstream jobs to finish') {
12
+ triggeredByUpstream = (currentBuild.rawBuild.getCause(hudson.model.Cause$UpstreamCause) != null)
13
+ def triggerBuild = getTriggerBuild(currentBuild)
14
+ if (!triggerBuild) {
15
+ triggerBuild = [null, null]
16
+ }
17
+ upstreamBuilds = getUpstreamBuilds(upstreamJobNames, triggerBuild[0], triggerBuild[1])
6
18
 
7
- stage 'waiting for upstream jobs to finish'
8
- <%= render_template('wait-upstream.pipeline') %>
19
+ if (!waitForUpstreamBuilds(upstreamBuilds)) {
20
+ return
21
+ }
22
+ }
9
23
 
10
24
  node(label: 'autoproj-jenkins') {
25
+ def fullWorkspaceDir = pwd()
26
+ def autoproj = "${fullWorkspaceDir}/dev/.autoproj/bin/autoproj"
11
27
  dir('dev/install/log') { deleteDir() }
12
28
 
13
- stage 'bootstrap'
14
- <%= render_template('bootstrap.pipeline', vcs: buildconf_vcs, gemfile: gemfile, autoproj_install_path: autoproj_install_path, vcs_credentials: vcs_credentials, indent: 4) %>
15
- stage 'install upstream artifacts'
29
+ def jobPackagePrefix = null
30
+ def upstreamPackagePrefixes = null
16
31
 
17
- def upstreamDir = "artifacts/upstream"
18
- def packagePrefixes = sh(script: "${autoproj} locate --no-cache --prefix '${jobPackageName}' ${upstreamPackageNames.join(" ")}", returnStdout: true).
19
- split("\n")
32
+ stage('bootstrap') {
33
+ <%= render_template('bootstrap.pipeline', vcs: buildconf_vcs, gemfile: gemfile, autoproj_install_path: autoproj_install_path, vcs_credentials: vcs_credentials, indent: 4) %>
20
34
 
21
- def jobPackagePrefix = packagePrefixes[0]
22
- def upstreamPackagePrefixes = packagePrefixes.tail()
35
+ def jenkins_dependency_overrides = "<%= render_template 'jenkins_dependency_overrides.rb', escape: true, package_name: package_name, upstream_jobs: upstream_jobs %>"
36
+ writeFile file: 'dev/autoproj/overrides.d/99_jenkins_dependency_overrides.rb',
37
+ text: jenkins_dependency_overrides
23
38
 
24
- parallel(makeUpstreamArtifactImporters(
25
- autoproj, fullWorkspaceDir, upstreamDir,
26
- upstreamJobNames, upstreamPackagePrefixes, upstreamBuilds)
27
- )
28
- // We don't need the upstream artifacts anymore, clear some disk space
29
- dir(upstreamDir) { deleteDir() }
39
+ def packagePrefixes = sh(script: "${autoproj} locate --no-cache --prefix '${jobPackageName}' ${upstreamPackageNames.join(" ")}", returnStdout: true).
40
+ split("\n")
30
41
 
31
- if (fileExists("lastPrefix")) {
32
- sh "mv lastPrefix '${jobPackagePrefix}'"
42
+ jobPackagePrefix = packagePrefixes[0]
43
+ upstreamPackagePrefixes = packagePrefixes.tail()
33
44
  }
34
45
 
35
- def jenkins_dependency_overrides = "<%= render_template 'jenkins_dependency_overrides.rb', escape: true, package_name: package_name, upstream_jobs: upstream_jobs %>"
36
- writeFile file: 'dev/autoproj/overrides.d/99_jenkins_dependency_overrides.rb',
37
- text: jenkins_dependency_overrides
46
+ stage('install upstream artifacts') {
47
+ installUpstreamArtifacts(autoproj, fullWorkspaceDir,
48
+ jobPackageName, jobPackagePrefix,
49
+ upstreamJobNames, upstreamPackagePrefixes, upstreamBuilds)
50
+ }
38
51
 
39
52
  dir('dev') {
40
- stage 'prepare build'
41
- <%= render_template("import-#{vcs.type}.pipeline",
42
- patch: true,
43
- allow_unused: true,
44
- package_dir: package_dir,
45
- vcs: vcs,
46
- credentials: vcs_credentials.for(vcs),
47
- package_name: package_name,
48
- indent: 8) %>
49
- sh "${autoproj} test disable '<%= package_name %>'"
50
- sh "${autoproj} osdeps '<%= package_name %>' 'pkg-config'"
51
-
52
- stage 'build'
53
- try {
54
- sh "${autoproj} build --force --deps=f '<%= package_name %>' -p1"
53
+ stage('prepare build') {
54
+ <%= render_template("import-#{vcs.type}.pipeline",
55
+ patch: true,
56
+ allow_unused: true,
57
+ package_dir: package_dir,
58
+ vcs: vcs,
59
+ credentials: vcs_credentials.for(vcs),
60
+ package_name: package_name,
61
+ indent: 8) %>
62
+ sh "${autoproj} test disable '<%= package_name %>'"
63
+ sh "${autoproj} osdeps '<%= package_name %>' 'pkg-config'"
55
64
  }
56
- catch(err) {
65
+
66
+ stage('build') {
67
+ try {
68
+ sh "${autoproj} build --force --deps=f '<%= package_name %>' -p1"
69
+ }
70
+ catch(err) {
71
+ archive includes: 'install/<%= package_name %>/log/<%= package_name %>-*.log'
72
+ throw(err)
73
+ }
57
74
  archive includes: 'install/<%= package_name %>/log/<%= package_name %>-*.log'
58
- throw(err)
59
75
  }
60
- archive includes: 'install/<%= package_name %>/log/<%= package_name %>-*.log'
61
76
  }
62
77
 
63
- stage 'trigger dependencies'
64
- <%= render_template('handle-downstream.pipeline',
65
- job_name: job_name,
66
- artifact_glob: artifact_glob,
67
- downstream_jobs: downstream_jobs,
68
- indent: 4) %>
69
-
70
- stage 'tests'
71
- def test_timestamp_path = "${fullWorkspaceDir}/test-timestamp"
72
- touch file: test_timestamp_path
73
- def test_output_path = "${fullWorkspaceDir}/test"
74
- def autoproj_test_failed = false
75
- dir('dev')
76
- {
77
- try {
78
- sh "${autoproj} test enable '<%= package_name %>'"
79
- sh "${autoproj} osdeps '<%= package_name %>'"
80
- sh "${autoproj} build --deps=f '<%= package_name %>' -p1"
81
- sh "${autoproj} test -p=1 '<%= package_name %>'"
78
+ stage('handle downstream') {
79
+ handleDownstream(autoproj, fullWorkspaceDir,
80
+ jobName, jobPackagePrefix, "<%= artifact_glob %>")
81
+ if (! triggeredByUpstream) {
82
+ <% downstream_jobs.each_key do |job_name| %>
83
+ build job: "<%= job_name %>", wait: false
84
+ <% end %>
82
85
  }
83
- catch(err) { autoproj_test_failed = true }
86
+ }
84
87
 
85
- try { sh "${autoproj} jenkins postprocess-tests --after=${test_timestamp_path} ${test_output_path} '<%= package_name %>'" }
88
+ stage('tests') {
89
+ def test_timestamp_path = "${fullWorkspaceDir}/test-timestamp"
90
+ touch file: test_timestamp_path
91
+ def test_output_path = "${fullWorkspaceDir}/test"
92
+ def autoproj_test_failed = false
93
+ dir('dev')
94
+ {
95
+ try {
96
+ sh "${autoproj} test enable '<%= package_name %>'"
97
+ sh "${autoproj} osdeps '<%= package_name %>'"
98
+ sh "${autoproj} build --deps=f '<%= package_name %>' -p1"
99
+ sh "${autoproj} test -p=1 '<%= package_name %>'"
100
+ }
101
+ catch(err) { autoproj_test_failed = true }
102
+
103
+ try { sh "${autoproj} jenkins postprocess-tests --after=${test_timestamp_path} ${test_output_path} '<%= package_name %>'" }
104
+ catch(err) { autoproj_test_failed = true }
105
+ }
106
+ try { junit allowEmptyResults: true, keepLongStdio: true, testResults: "test/*.xml" }
86
107
  catch(err) { autoproj_test_failed = true }
87
- }
88
- try { junit allowEmptyResults: true, keepLongStdio: true, testResults: "test/*.xml" }
89
- catch(err) { autoproj_test_failed = true }
90
108
 
91
- if (autoproj_test_failed)
92
- {
93
- currentBuild.result = 'UNSTABLE'
109
+ if (autoproj_test_failed)
110
+ {
111
+ currentBuild.result = 'UNSTABLE'
112
+ }
94
113
  }
95
114
 
96
115
  // Move the current package prefix to a separate folder, to ensure that
@@ -50,7 +50,7 @@ module Autoproj::Jenkins
50
50
  # with --dev or not
51
51
  # @param [Array<Autoproj::PackageDefinition>] packages if non-empty,
52
52
  # restrict operations to these packages and their dependencies
53
- def update_buildconf_pipeline(*package_names, gemfile: 'buildconf-Gemfile', autoproj_install_path: nil, dev: false, credentials_id: nil, vcs_credentials: Credentials.new)
53
+ def update_buildconf_pipeline(*packages, gemfile: 'buildconf-Gemfile', autoproj_install_path: nil, dev: false, credentials_id: nil, vcs_credentials: Credentials.new)
54
54
  manifest_vcs = ws.manifest.vcs
55
55
  if manifest_vcs.local? || manifest_vcs.none?
56
56
  raise ArgumentError, "cannot use Jenkins to build an autoproj buildconf that is not on a remotely acessible VCS"
@@ -59,7 +59,7 @@ module Autoproj::Jenkins
59
59
  job_name = job_name_from_package_name("buildconf")
60
60
  server.update_job_pipeline(job_name, 'buildconf.pipeline',
61
61
  vcs: manifest_vcs,
62
- package_names: package_names,
62
+ package_names: packages.map(&:name),
63
63
  gemfile: gemfile,
64
64
  autoproj_install_path: autoproj_install_path,
65
65
  job_prefix: job_prefix,
@@ -1,5 +1,5 @@
1
1
  module Autoproj
2
2
  module Jenkins
3
- VERSION = "0.2.2"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoproj-jenkins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Joyeux
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-15 00:00:00.000000000 Z
11
+ date: 2016-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jenkins_api_client
@@ -131,23 +131,21 @@ files:
131
131
  - lib/autoproj/jenkins/relativize.rb
132
132
  - lib/autoproj/jenkins/render_template.rb
133
133
  - lib/autoproj/jenkins/server.rb
134
- - lib/autoproj/jenkins/templates/abort-if-upstream-failed.pipeline.erb
135
134
  - lib/autoproj/jenkins/templates/bootstrap.pipeline.erb
136
135
  - lib/autoproj/jenkins/templates/buildconf-Gemfile
137
136
  - lib/autoproj/jenkins/templates/buildconf-config.yml.erb
138
137
  - lib/autoproj/jenkins/templates/buildconf-vagrant-Gemfile
139
138
  - lib/autoproj/jenkins/templates/buildconf.pipeline.erb
140
139
  - lib/autoproj/jenkins/templates/buildconf.xml.erb
141
- - lib/autoproj/jenkins/templates/handle-downstream.pipeline.erb
142
140
  - lib/autoproj/jenkins/templates/import-archive.pipeline.erb
143
141
  - lib/autoproj/jenkins/templates/import-git.pipeline.erb
144
142
  - lib/autoproj/jenkins/templates/import-svn.pipeline.erb
145
143
  - lib/autoproj/jenkins/templates/jenkins_dependency_overrides.rb.erb
144
+ - lib/autoproj/jenkins/templates/library.pipeline.erb
146
145
  - lib/autoproj/jenkins/templates/package-Gemfile
147
146
  - lib/autoproj/jenkins/templates/package.pipeline.erb
148
147
  - lib/autoproj/jenkins/templates/package.xml.erb
149
148
  - lib/autoproj/jenkins/templates/setup-git-credentials.pipeline.erb
150
- - lib/autoproj/jenkins/templates/wait-upstream.pipeline.erb
151
149
  - lib/autoproj/jenkins/test_format_converters/boost-test.xsl
152
150
  - lib/autoproj/jenkins/updater.rb
153
151
  - lib/autoproj/jenkins/version.rb
@@ -1,18 +0,0 @@
1
- def upstream_jobs = [<%= upstream_jobs.each_key.map { |job_name| "'#{job_name}'" }.join(", ") %>]
2
-
3
- // Iterate list -- NOTE: we cannot use groovy style or even modern java style iteration
4
- for (int i = 0; i < upstream_jobs.size(); i++) {
5
- def job = Jenkins.instance.getItem(upstream_jobs[i])
6
- if (!job) {
7
- error("cannot find upstream job ${upstream_jobs[i]}")
8
- }
9
-
10
- def result = job.getLastBuild().getResult()
11
- if (result != Result.SUCCESS && result != Result.UNSTABLE)
12
- {
13
- echo "${upstream_jobs[i]} did not finish successfully, aborting this build"
14
- currentBuild.result = 'NOT_BUILT';
15
- return;
16
- }
17
- }
18
-
@@ -1,20 +0,0 @@
1
- def downstreamDir = "artifacts/downstream"
2
- def targetArtifactPath = "${fullWorkspaceDir}/${downstreamDir}/<%= job_name %>-prefix.zip"
3
-
4
- dir(downstreamDir) { deleteDir() }
5
- dir("${downstreamDir}/<%= job_name %>") {
6
- sh "rsync '${jobPackagePrefix}/' './' -a --delete"
7
- sh "${autoproj} jenkins relativize ./ '${fullWorkspaceDir}' '@WORKSPACE_ROOT@'"
8
- zip zipFile: targetArtifactPath, glob: "<%= artifact_glob %>"
9
- }
10
- dir(downstreamDir) {
11
- archiveArtifacts artifacts: "*.zip"
12
- deleteDir()
13
- }
14
-
15
- if (triggeredByUser) { // Defined in handle-upstream.pipeline.erb
16
- <% downstream_jobs.each_key do |job_name| %>
17
- build job: "<%= job_name %>", wait: false
18
- <% end %>
19
- }
20
-