concourse 0.29.0 → 0.34.0
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/CHANGELOG.md +26 -0
- data/README.md +24 -0
- data/concourse.gemspec +15 -15
- data/lib/concourse.rb +22 -13
- data/lib/concourse/util.rb +3 -2
- data/lib/concourse/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: baf385b29c11940d30e629579e3a49cbece674505744784cd76bc2c2ba555a57
|
4
|
+
data.tar.gz: 137a75561ca03dae7bf5d261ead42d23ad529646e4ff88af19210bed13030317
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccf56e48803d7af6f9cebb66c88982cab01bd879360fe9035ecc86604ff14712f4ab27d4429e25e0540cb13780db30cf43f88e22136a18a29651e70b9de4ce7f
|
7
|
+
data.tar.gz: 14e5a4f401c650605da01391b2892bd636e5a8dc5ec847945a22c9fef8f41806e1c852b42e6a4bc00c014db5b82bfc0b8f020f6bdf50684cf99952ba9c87aad2
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,31 @@
|
|
1
1
|
# concourse-gem changelog
|
2
2
|
|
3
|
+
## v0.34.0 / 2020-08-31
|
4
|
+
|
5
|
+
* allow injection of fly command arguments via `fly_args_<command_name>`
|
6
|
+
|
7
|
+
|
8
|
+
## v0.33.0 / 2020-03-31
|
9
|
+
|
10
|
+
* add `format` option for formatting final pipeline files with `fly format-pipeline`
|
11
|
+
|
12
|
+
|
13
|
+
## v0.32.0 / 2020-03-29
|
14
|
+
|
15
|
+
* avoid deprecation warning for `Bundler.with_clean_env`
|
16
|
+
|
17
|
+
|
18
|
+
## v0.31.0 / 2020-01-11
|
19
|
+
|
20
|
+
* remove jruby 9.1 (which corresponds to ruby 2.3)
|
21
|
+
|
22
|
+
|
23
|
+
## v0.30.0 / 2020-01-11
|
24
|
+
|
25
|
+
* remove ruby 2.3, which has reached EOL
|
26
|
+
* change ruby 2.7-rc to 2.7 (final)
|
27
|
+
|
28
|
+
|
3
29
|
## v0.29.0 / 2019-10-28
|
4
30
|
|
5
31
|
* add `2.7-rc` to the set of MRI Rubies
|
data/README.md
CHANGED
@@ -225,6 +225,17 @@ Concourse.new("myproject", fly_target: "myci").create_tasks! # `fly -t myci <com
|
|
225
225
|
```
|
226
226
|
|
227
227
|
|
228
|
+
### `format`: Emit the final pipelines in `fly format-pipeline` canonical format
|
229
|
+
|
230
|
+
If you'd prefer to have your final pipeline files in `fly`'s "canonical format" (via `format-pipeline`), then set this to true!
|
231
|
+
|
232
|
+
``` ruby
|
233
|
+
Concourse.new("myproject", format: true).create_tasks!
|
234
|
+
```
|
235
|
+
|
236
|
+
This might be useful if you're heavily refactoring your template, and want to make sure there aren't unexpected changes to the pipeline.
|
237
|
+
|
238
|
+
|
228
239
|
### `pipeline_erb_filename`: Pipeline filename
|
229
240
|
|
230
241
|
By default the pipeline file will be named `<myproject>.yml`, but can be set to something else:
|
@@ -246,6 +257,19 @@ Concourse.new("myproject", secrets_filename: "secrets.yml").create_tasks!
|
|
246
257
|
```
|
247
258
|
|
248
259
|
|
260
|
+
### `fly_args_<fly_command>`: fly command arguments
|
261
|
+
|
262
|
+
Rarely, you may need to inject additional commandline arguments into `fly` to get the behavior you want. For example, I wanted to inject `--enable-across-step` into my `validate-pipeline` commands when I started exploring matrix builds via [the `across` step](https://github.com/vito/rfcs/blob/spatial-resources/029-across-step/proposal.md).
|
263
|
+
|
264
|
+
You can pass in additional keys named `fly_args_<command-name-with-underscores>` like this:
|
265
|
+
|
266
|
+
``` ruby
|
267
|
+
Concourse.new("myproject", fly_args_validate_pipeline: "--enable-across-step --another-flag")
|
268
|
+
```
|
269
|
+
|
270
|
+
With the above initializer call, whenever the `concourse` gem invokes `validate-pipeline`, it will inject `--enable-across-step --another-flag`.
|
271
|
+
|
272
|
+
|
249
273
|
## Rake Tasks
|
250
274
|
|
251
275
|
|
data/concourse.gemspec
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
lib = File.expand_path(
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
4
|
+
require "concourse/version"
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name
|
8
|
-
spec.version
|
9
|
-
spec.authors
|
10
|
-
spec.email
|
7
|
+
spec.name = "concourse"
|
8
|
+
spec.version = Concourse::VERSION
|
9
|
+
spec.authors = ["Mike Dalessio"]
|
10
|
+
spec.email = ["mike.dalessio@gmail.com"]
|
11
11
|
|
12
|
-
spec.summary
|
13
|
-
spec.description
|
14
|
-
spec.homepage
|
15
|
-
spec.license
|
12
|
+
spec.summary = "Rake tasks for Concourse pipelines."
|
13
|
+
spec.description = "Provide Rake tasks to ease management of Concourse pipelines. See https://concourse.ci/ to learn about Concourse."
|
14
|
+
spec.homepage = "https://github.com/flavorjones/concourse-gem"
|
15
|
+
spec.license = "MIT"
|
16
16
|
|
17
|
-
spec.files
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
18
|
f.match(%r{^(test|spec|features)/})
|
19
19
|
end
|
20
|
-
spec.bindir
|
21
|
-
spec.executables
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
24
|
spec.add_dependency "term-ansicolor"
|
25
25
|
|
26
|
-
spec.add_development_dependency "bundler", "~> 1.
|
27
|
-
spec.add_development_dependency "rake", "~>
|
26
|
+
spec.add_development_dependency "bundler", "~> 2.1.4"
|
27
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
28
28
|
spec.add_development_dependency "rspec", "~> 3.0"
|
29
29
|
end
|
data/lib/concourse.rb
CHANGED
@@ -11,10 +11,10 @@ class Concourse
|
|
11
11
|
|
12
12
|
# these numbers/names align with public docker image names
|
13
13
|
RUBIES = {
|
14
|
-
mri: %w[2.
|
15
|
-
jruby: %w[9.
|
16
|
-
rbx: %w[latest],
|
17
|
-
windows: %w[2.3 2.4 2.5 2.6],
|
14
|
+
mri: %w[2.4 2.5 2.6 2.7], # docker repository: "ruby"
|
15
|
+
jruby: %w[9.2], # docker repository: "jruby"
|
16
|
+
rbx: %w[latest], # docker repository: "rubinius/docker"
|
17
|
+
windows: %w[2.3 2.4 2.5 2.6], # windows-ruby-dev-tools-release
|
18
18
|
}
|
19
19
|
|
20
20
|
DEFAULT_DIRECTORY = "concourse"
|
@@ -25,7 +25,9 @@ class Concourse
|
|
25
25
|
attr_reader :directory
|
26
26
|
attr_reader :pipelines
|
27
27
|
attr_reader :fly_target
|
28
|
+
attr_reader :fly_args
|
28
29
|
attr_reader :secrets_filename
|
30
|
+
attr_reader :format
|
29
31
|
|
30
32
|
CONCOURSE_DOCKER_COMPOSE = "docker-compose.yml"
|
31
33
|
|
@@ -56,6 +58,12 @@ class Concourse
|
|
56
58
|
|
57
59
|
@directory = options[:directory] || DEFAULT_DIRECTORY
|
58
60
|
@fly_target = options[:fly_target] || DEFAULT_FLY_TARGET
|
61
|
+
@format = options.has_key?(:format) ? options[:format] : false
|
62
|
+
@fly_args = options.keys.grep(/^fly_args_/).inject({}) do |hash, key|
|
63
|
+
fly_command = key.to_s.gsub(/^fly_args_/, "").gsub("_", "-")
|
64
|
+
hash[fly_command] = options[key]
|
65
|
+
hash
|
66
|
+
end
|
59
67
|
|
60
68
|
base_secrets_filename = options[:secrets_filename] || DEFAULT_SECRETS
|
61
69
|
@secrets_filename = File.join(@directory, base_secrets_filename)
|
@@ -89,14 +97,15 @@ class Concourse
|
|
89
97
|
File.open pipeline.filename, "w" do |f|
|
90
98
|
f.write erbify_file(pipeline.erb_filename, working_directory: directory)
|
91
99
|
end
|
92
|
-
fly "validate-pipeline -c #{pipeline.filename}"
|
100
|
+
fly "validate-pipeline", "-c #{pipeline.filename}"
|
101
|
+
fly "format-pipeline", "-c #{pipeline.filename} -w" if format
|
93
102
|
end
|
94
103
|
|
95
104
|
def ensure_docker_compose_file
|
96
105
|
return if File.exist?(docker_compose_path)
|
97
106
|
note "fetching docker compose file ..."
|
98
107
|
File.open(docker_compose_path, "w") do |f|
|
99
|
-
f.write open("https://concourse-ci.org/docker-compose.yml").read
|
108
|
+
f.write URI.open("https://concourse-ci.org/docker-compose.yml").read
|
100
109
|
sh "docker pull concourse/concourse"
|
101
110
|
end
|
102
111
|
end
|
@@ -104,7 +113,7 @@ class Concourse
|
|
104
113
|
def rake_concourse_local
|
105
114
|
ensure_docker_compose_file
|
106
115
|
@fly_target = "local"
|
107
|
-
fly "login -u test -p test -c http://127.0.0.1:8080"
|
116
|
+
fly "login", "-u test -p test -c http://127.0.0.1:8080"
|
108
117
|
end
|
109
118
|
|
110
119
|
def rake_concourse_local_up
|
@@ -167,7 +176,7 @@ class Concourse
|
|
167
176
|
note "using #{secrets_filename} to resolve template vars in #{pipeline.filename}"
|
168
177
|
options << "-l '#{secrets_filename}'"
|
169
178
|
end
|
170
|
-
fly "set-pipeline
|
179
|
+
fly "set-pipeline", options.join(" ")
|
171
180
|
end
|
172
181
|
end
|
173
182
|
|
@@ -178,7 +187,7 @@ class Concourse
|
|
178
187
|
pipelines.each do |pipeline|
|
179
188
|
desc "#{command} the #{pipeline.name} pipeline"
|
180
189
|
task "#{command}:#{pipeline.name}" do
|
181
|
-
fly "#{command}-pipeline -p #{pipeline.name}"
|
190
|
+
fly "#{command}-pipeline", "-p #{pipeline.name}"
|
182
191
|
end
|
183
192
|
end
|
184
193
|
end
|
@@ -229,8 +238,8 @@ class Concourse
|
|
229
238
|
Tempfile.create("concourse-task") do |f|
|
230
239
|
f.write concourse_task["config"].to_yaml
|
231
240
|
f.close
|
232
|
-
Bundler.
|
233
|
-
fly "execute #{fly_execute_args} -c #{f.path}"
|
241
|
+
Bundler.with_unbundled_env do
|
242
|
+
fly "execute", "#{fly_execute_args} -c #{f.path}"
|
234
243
|
end
|
235
244
|
end
|
236
245
|
end
|
@@ -244,7 +253,7 @@ class Concourse
|
|
244
253
|
pipeline_job, build_id, status = *line.split(/\s+/)[1, 3]
|
245
254
|
next unless status == "started"
|
246
255
|
|
247
|
-
fly "abort-build -j #{pipeline_job} -b #{build_id}"
|
256
|
+
fly "abort-build", "-j #{pipeline_job} -b #{build_id}"
|
248
257
|
end
|
249
258
|
end
|
250
259
|
|
@@ -255,7 +264,7 @@ class Concourse
|
|
255
264
|
task "prune-stalled-workers" do
|
256
265
|
`fly -t #{fly_target} workers | fgrep stalled`.each_line do |line|
|
257
266
|
worker_id = line.split.first
|
258
|
-
fly "prune-worker -w #{worker_id}"
|
267
|
+
fly "prune-worker", "-w #{worker_id}"
|
259
268
|
end
|
260
269
|
end
|
261
270
|
|
data/lib/concourse/util.rb
CHANGED
@@ -18,8 +18,9 @@ class Concourse
|
|
18
18
|
File.open(GITIGNORE_FILE, "a") { |f| f.puts file_glob }
|
19
19
|
end
|
20
20
|
|
21
|
-
def fly command
|
22
|
-
|
21
|
+
def fly command, args
|
22
|
+
command_args = Array(fly_args[command])
|
23
|
+
sh "fly -t #{fly_target} #{command} #{command_args.join(" ")} #{args}"
|
23
24
|
end
|
24
25
|
|
25
26
|
def docker_compose command
|
data/lib/concourse/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: concourse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.34.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Dalessio
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: term-ansicolor
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 2.1.4
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 2.1.4
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '13.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '13.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
|
-
rubygems_version: 3.
|
110
|
+
rubygems_version: 3.1.2
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Rake tasks for Concourse pipelines.
|