concourse 0.30.0 → 0.35.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 +31 -0
- data/README.md +26 -0
- data/lib/concourse.rb +19 -17
- data/lib/concourse/util.rb +3 -2
- data/lib/concourse/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0e735d8ab6d592e3bc060b06f9b4e26dcef1312d05289910fa310658edd1f1e
|
4
|
+
data.tar.gz: 6011194849c21c817ac5e089c350bac9adbff6179b3f5de7449748c45b7df474
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab27e018c417be11f6a5f11cddb7f7ddfb93cf55186f9a331f974ecc789dd3f0f749132faec345933d04fe52bd4b618a3e33e3b015429dce86f72a42b2a947ba
|
7
|
+
data.tar.gz: 90daa7b65136f480da999018e97d5b9f344b940faa7df7308541c1ae7e5de1f34abcdbf05c6fe143c46cd93a9d8674801eb5c9b227e27beda9b1ccfc7c9593d8
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,36 @@
|
|
1
1
|
# concourse-gem changelog
|
2
2
|
|
3
|
+
## v0.35.0 / 2020-09-07
|
4
|
+
|
5
|
+
* remove "clean" rake task (generated pipelines have been recommended for checkin to source control since v0.26.0)
|
6
|
+
|
7
|
+
|
8
|
+
## v0.34.0 / 2020-08-31
|
9
|
+
|
10
|
+
* allow injection of fly command arguments via `fly_args_<command_name>`
|
11
|
+
|
12
|
+
|
13
|
+
## v0.33.0 / 2020-03-31
|
14
|
+
|
15
|
+
* add `format` option for formatting final pipeline files with `fly format-pipeline`
|
16
|
+
|
17
|
+
|
18
|
+
## v0.32.0 / 2020-03-29
|
19
|
+
|
20
|
+
* avoid deprecation warning for `Bundler.with_clean_env`
|
21
|
+
|
22
|
+
|
23
|
+
## v0.31.0 / 2020-01-11
|
24
|
+
|
25
|
+
* remove jruby 9.1 (which corresponds to ruby 2.3)
|
26
|
+
|
27
|
+
|
28
|
+
## v0.30.0 / 2020-01-11
|
29
|
+
|
30
|
+
* remove ruby 2.3, which has reached EOL
|
31
|
+
* change ruby 2.7-rc to 2.7 (final)
|
32
|
+
|
33
|
+
|
3
34
|
## v0.29.0 / 2019-10-28
|
4
35
|
|
5
36
|
* add `2.7-rc` to the set of MRI Rubies
|
data/README.md
CHANGED
@@ -28,8 +28,10 @@ Here's an example pipeline maintained by this gem:
|
|
28
28
|
- [Configuration](#configuration)
|
29
29
|
* [`directory`: Concourse subdirectory name](#directory-concourse-subdirectory-name)
|
30
30
|
* [`fly_target`: Concourse `fly` target name](#fly_target-concourse-fly-target-name)
|
31
|
+
* [`format`: Emit the final pipelines in `fly format-pipeline` canonical format](#format-emit-the-final-pipelines-in-fly-format-pipeline-canonical-format)
|
31
32
|
* [`pipeline_erb_filename`: Pipeline filename](#pipeline_erb_filename-pipeline-filename)
|
32
33
|
* [`secrets_filename`: Secrets filename](#secrets_filename-secrets-filename)
|
34
|
+
* [`fly_args_`: fly command arguments](#fly_args_-fly-command-arguments)
|
33
35
|
- [Rake Tasks](#rake-tasks)
|
34
36
|
* [Manage your Concourse pipeline](#manage-your-concourse-pipeline)
|
35
37
|
* [List pipeline tasks](#list-pipeline-tasks)
|
@@ -225,6 +227,17 @@ Concourse.new("myproject", fly_target: "myci").create_tasks! # `fly -t myci <com
|
|
225
227
|
```
|
226
228
|
|
227
229
|
|
230
|
+
### `format`: Emit the final pipelines in `fly format-pipeline` canonical format
|
231
|
+
|
232
|
+
If you'd prefer to have your final pipeline files in `fly`'s "canonical format" (via `format-pipeline`), then set this to true!
|
233
|
+
|
234
|
+
``` ruby
|
235
|
+
Concourse.new("myproject", format: true).create_tasks!
|
236
|
+
```
|
237
|
+
|
238
|
+
This might be useful if you're heavily refactoring your template, and want to make sure there aren't unexpected changes to the pipeline.
|
239
|
+
|
240
|
+
|
228
241
|
### `pipeline_erb_filename`: Pipeline filename
|
229
242
|
|
230
243
|
By default the pipeline file will be named `<myproject>.yml`, but can be set to something else:
|
@@ -246,6 +259,19 @@ Concourse.new("myproject", secrets_filename: "secrets.yml").create_tasks!
|
|
246
259
|
```
|
247
260
|
|
248
261
|
|
262
|
+
### `fly_args_<fly_command>`: fly command arguments
|
263
|
+
|
264
|
+
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).
|
265
|
+
|
266
|
+
You can pass in additional keys named `fly_args_<command-name-with-underscores>` like this:
|
267
|
+
|
268
|
+
``` ruby
|
269
|
+
Concourse.new("myproject", fly_args_validate_pipeline: "--enable-across-step --another-flag")
|
270
|
+
```
|
271
|
+
|
272
|
+
With the above initializer call, whenever the `concourse` gem invokes `validate-pipeline`, it will inject `--enable-across-step --another-flag`.
|
273
|
+
|
274
|
+
|
249
275
|
## Rake Tasks
|
250
276
|
|
251
277
|
|
data/lib/concourse.rb
CHANGED
@@ -12,7 +12,7 @@ class Concourse
|
|
12
12
|
# these numbers/names align with public docker image names
|
13
13
|
RUBIES = {
|
14
14
|
mri: %w[2.4 2.5 2.6 2.7], # docker repository: "ruby"
|
15
|
-
jruby: %w[9.
|
15
|
+
jruby: %w[9.2], # docker repository: "jruby"
|
16
16
|
rbx: %w[latest], # docker repository: "rubinius/docker"
|
17
17
|
windows: %w[2.3 2.4 2.5 2.6], # windows-ruby-dev-tools-release
|
18
18
|
}
|
@@ -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,18 +187,11 @@ 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
|
185
194
|
|
186
|
-
desc "remove generated pipeline files"
|
187
|
-
task "clean" do
|
188
|
-
pipelines.each do |pipeline|
|
189
|
-
rm_f pipeline.filename
|
190
|
-
end
|
191
|
-
end
|
192
|
-
|
193
195
|
#
|
194
196
|
# task commands
|
195
197
|
#
|
@@ -229,8 +231,8 @@ class Concourse
|
|
229
231
|
Tempfile.create("concourse-task") do |f|
|
230
232
|
f.write concourse_task["config"].to_yaml
|
231
233
|
f.close
|
232
|
-
Bundler.
|
233
|
-
fly "execute
|
234
|
+
Bundler.with_unbundled_env do
|
235
|
+
fly "execute", [fly_execute_args, "-c #{f.path}"].compact.join(" ")
|
234
236
|
end
|
235
237
|
end
|
236
238
|
end
|
@@ -244,7 +246,7 @@ class Concourse
|
|
244
246
|
pipeline_job, build_id, status = *line.split(/\s+/)[1, 3]
|
245
247
|
next unless status == "started"
|
246
248
|
|
247
|
-
fly "abort-build -j #{pipeline_job} -b #{build_id}"
|
249
|
+
fly "abort-build", "-j #{pipeline_job} -b #{build_id}"
|
248
250
|
end
|
249
251
|
end
|
250
252
|
|
@@ -255,7 +257,7 @@ class Concourse
|
|
255
257
|
task "prune-stalled-workers" do
|
256
258
|
`fly -t #{fly_target} workers | fgrep stalled`.each_line do |line|
|
257
259
|
worker_id = line.split.first
|
258
|
-
fly "prune-worker -w #{worker_id}"
|
260
|
+
fly "prune-worker", "-w #{worker_id}"
|
259
261
|
end
|
260
262
|
end
|
261
263
|
|
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, args].flatten.compact.join(" ")
|
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.35.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: 2020-
|
11
|
+
date: 2020-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: term-ansicolor
|