concourse 0.33.0 → 0.38.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 +25 -0
- data/README.md +15 -0
- data/lib/concourse.rb +16 -18
- 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: 4545117f3a9ab7e87861ed9d985f4ce559ef5636ab4c90f9dc72d0415a53f65d
|
4
|
+
data.tar.gz: d15f26777dff8e5f63e0da5ffbab5e036b83381680bb3782039843a323dab64e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3c56b95c58c91946b229e17f46adb1131268354100fc346ac98829db3c17e056c4f2c70ebad9dd8cafc5dd2f8c2b8d2e038e413d0d5404782bc078b4a8d94d7
|
7
|
+
data.tar.gz: fff0b1b7943cb4fc1fbd67a3c2a4360682718eefa0baca151a09f694ccb41882eeeecb58fe6742e32f6e2d1d02a8eef2dfbaeba06137dfa56304467d193543c2
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,30 @@
|
|
1
1
|
# concourse-gem changelog
|
2
2
|
|
3
|
+
## v0.38.0 / 2020-10-01
|
4
|
+
|
5
|
+
* add ruby 3.0-rc
|
6
|
+
|
7
|
+
|
8
|
+
## v0.37.0 / 2020-10-01
|
9
|
+
|
10
|
+
* add TruffleRuby ("truffle") as a known Ruby
|
11
|
+
|
12
|
+
|
13
|
+
## v0.36.0 / 2020-09-07
|
14
|
+
|
15
|
+
* remove generated pipelines from rake's "CLOBBER" global (generated pipelines have been recommended for checkin to source control since v0.26.0)
|
16
|
+
|
17
|
+
|
18
|
+
## v0.35.0 / 2020-09-07
|
19
|
+
|
20
|
+
* remove "clean" rake task (generated pipelines have been recommended for checkin to source control since v0.26.0)
|
21
|
+
|
22
|
+
|
23
|
+
## v0.34.0 / 2020-08-31
|
24
|
+
|
25
|
+
* allow injection of fly command arguments via `fly_args_<command_name>`
|
26
|
+
|
27
|
+
|
3
28
|
## v0.33.0 / 2020-03-31
|
4
29
|
|
5
30
|
* add `format` option for formatting final pipeline files with `fly format-pipeline`
|
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)
|
@@ -257,6 +259,19 @@ Concourse.new("myproject", secrets_filename: "secrets.yml").create_tasks!
|
|
257
259
|
```
|
258
260
|
|
259
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
|
+
|
260
275
|
## Rake Tasks
|
261
276
|
|
262
277
|
|
data/lib/concourse.rb
CHANGED
@@ -11,10 +11,11 @@ class Concourse
|
|
11
11
|
|
12
12
|
# these numbers/names align with public docker image names
|
13
13
|
RUBIES = {
|
14
|
-
mri: %w[2.4 2.5 2.6 2.7], # docker repository: "ruby"
|
14
|
+
mri: %w[2.4 2.5 2.6 2.7 3.0-rc], # docker repository: "ruby"
|
15
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
|
+
truffle: %w[stable nightly] # docker repository: flavorjones/truffleruby
|
18
19
|
}
|
19
20
|
|
20
21
|
DEFAULT_DIRECTORY = "concourse"
|
@@ -25,6 +26,7 @@ class Concourse
|
|
25
26
|
attr_reader :directory
|
26
27
|
attr_reader :pipelines
|
27
28
|
attr_reader :fly_target
|
29
|
+
attr_reader :fly_args
|
28
30
|
attr_reader :secrets_filename
|
29
31
|
attr_reader :format
|
30
32
|
|
@@ -58,6 +60,11 @@ class Concourse
|
|
58
60
|
@directory = options[:directory] || DEFAULT_DIRECTORY
|
59
61
|
@fly_target = options[:fly_target] || DEFAULT_FLY_TARGET
|
60
62
|
@format = options.has_key?(:format) ? options[:format] : false
|
63
|
+
@fly_args = options.keys.grep(/^fly_args_/).inject({}) do |hash, key|
|
64
|
+
fly_command = key.to_s.gsub(/^fly_args_/, "").gsub("_", "-")
|
65
|
+
hash[fly_command] = options[key]
|
66
|
+
hash
|
67
|
+
end
|
61
68
|
|
62
69
|
base_secrets_filename = options[:secrets_filename] || DEFAULT_SECRETS
|
63
70
|
@secrets_filename = File.join(@directory, base_secrets_filename)
|
@@ -91,8 +98,8 @@ class Concourse
|
|
91
98
|
File.open pipeline.filename, "w" do |f|
|
92
99
|
f.write erbify_file(pipeline.erb_filename, working_directory: directory)
|
93
100
|
end
|
94
|
-
fly "validate-pipeline -c #{pipeline.filename}"
|
95
|
-
fly "format-pipeline -c #{pipeline.filename} -w" if format
|
101
|
+
fly "validate-pipeline", "-c #{pipeline.filename}"
|
102
|
+
fly "format-pipeline", "-c #{pipeline.filename} -w" if format
|
96
103
|
end
|
97
104
|
|
98
105
|
def ensure_docker_compose_file
|
@@ -107,7 +114,7 @@ class Concourse
|
|
107
114
|
def rake_concourse_local
|
108
115
|
ensure_docker_compose_file
|
109
116
|
@fly_target = "local"
|
110
|
-
fly "login -u test -p test -c http://127.0.0.1:8080"
|
117
|
+
fly "login", "-u test -p test -c http://127.0.0.1:8080"
|
111
118
|
end
|
112
119
|
|
113
120
|
def rake_concourse_local_up
|
@@ -127,8 +134,6 @@ class Concourse
|
|
127
134
|
end
|
128
135
|
|
129
136
|
pipelines.each do |pipeline|
|
130
|
-
CLOBBER.include pipeline.filename if defined?(CLOBBER)
|
131
|
-
|
132
137
|
unless File.exist? pipeline.erb_filename
|
133
138
|
warn "WARNING: concourse template #{pipeline.erb_filename.inspect} does not exist, run `rake concourse:init`"
|
134
139
|
end
|
@@ -170,7 +175,7 @@ class Concourse
|
|
170
175
|
note "using #{secrets_filename} to resolve template vars in #{pipeline.filename}"
|
171
176
|
options << "-l '#{secrets_filename}'"
|
172
177
|
end
|
173
|
-
fly "set-pipeline
|
178
|
+
fly "set-pipeline", options.join(" ")
|
174
179
|
end
|
175
180
|
end
|
176
181
|
|
@@ -181,18 +186,11 @@ class Concourse
|
|
181
186
|
pipelines.each do |pipeline|
|
182
187
|
desc "#{command} the #{pipeline.name} pipeline"
|
183
188
|
task "#{command}:#{pipeline.name}" do
|
184
|
-
fly "#{command}-pipeline -p #{pipeline.name}"
|
189
|
+
fly "#{command}-pipeline", "-p #{pipeline.name}"
|
185
190
|
end
|
186
191
|
end
|
187
192
|
end
|
188
193
|
|
189
|
-
desc "remove generated pipeline files"
|
190
|
-
task "clean" do
|
191
|
-
pipelines.each do |pipeline|
|
192
|
-
rm_f pipeline.filename
|
193
|
-
end
|
194
|
-
end
|
195
|
-
|
196
194
|
#
|
197
195
|
# task commands
|
198
196
|
#
|
@@ -233,7 +231,7 @@ class Concourse
|
|
233
231
|
f.write concourse_task["config"].to_yaml
|
234
232
|
f.close
|
235
233
|
Bundler.with_unbundled_env do
|
236
|
-
fly "execute
|
234
|
+
fly "execute", [fly_execute_args, "-c #{f.path}"].compact.join(" ")
|
237
235
|
end
|
238
236
|
end
|
239
237
|
end
|
@@ -247,7 +245,7 @@ class Concourse
|
|
247
245
|
pipeline_job, build_id, status = *line.split(/\s+/)[1, 3]
|
248
246
|
next unless status == "started"
|
249
247
|
|
250
|
-
fly "abort-build -j #{pipeline_job} -b #{build_id}"
|
248
|
+
fly "abort-build", "-j #{pipeline_job} -b #{build_id}"
|
251
249
|
end
|
252
250
|
end
|
253
251
|
|
@@ -258,7 +256,7 @@ class Concourse
|
|
258
256
|
task "prune-stalled-workers" do
|
259
257
|
`fly -t #{fly_target} workers | fgrep stalled`.each_line do |line|
|
260
258
|
worker_id = line.split.first
|
261
|
-
fly "prune-worker -w #{worker_id}"
|
259
|
+
fly "prune-worker", "-w #{worker_id}"
|
262
260
|
end
|
263
261
|
end
|
264
262
|
|
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.38.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-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: term-ansicolor
|