concourse 0.26.0 → 0.27.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +39 -26
- data/README.md +31 -10
- data/assets/nokogiri-master-pipeline.png +0 -0
- data/lib/concourse.rb +25 -18
- data/lib/concourse/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdb08ded6bc7add4c5b21fa081ceb9a52283c9081bf7ae1094c5a48b7f1758fa
|
4
|
+
data.tar.gz: 0a0c4cc019356a598654b19a27be40586fcc07f56c4ef21f96974e0596c1c6ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0db62a2d34244fa3299b762b18ce9b2d16923b490b8c3ecef41c441f127c0d04d870045fac6ceb9ef1f895b0a2dda2650785f980915f28b3462dbc079ce486ce
|
7
|
+
data.tar.gz: 861dbb07056210372edd4e0f4dc371bf76f7851a56839f82756727400884c5dbd68e6c47cb013a27d846ce504d8655300fcea58dc7761bfa621559f2245149b2
|
data/CHANGELOG.md
CHANGED
@@ -1,20 +1,33 @@
|
|
1
1
|
# concourse-gem changelog
|
2
2
|
|
3
|
-
##
|
3
|
+
## v0.27.0 / 2019-04-28
|
4
|
+
|
5
|
+
### Features
|
6
|
+
|
7
|
+
* Provide description for the `concourse:local` rake task.
|
8
|
+
* `concourse:task` resolves private variables.
|
9
|
+
|
10
|
+
|
11
|
+
### Bug fixes
|
12
|
+
|
13
|
+
* Update error message for `concourse:task` task to match actual args.
|
14
|
+
|
15
|
+
|
16
|
+
## v0.26.0 / 2019-02-02
|
4
17
|
|
5
18
|
### Breaking changes
|
6
19
|
|
7
20
|
* Generated pipeline files are no longer `.gitignore`d.
|
8
21
|
|
9
22
|
|
10
|
-
##
|
23
|
+
## v0.25.0 / 2019-02-02
|
11
24
|
|
12
25
|
### Features
|
13
26
|
|
14
27
|
* Support running a local ephemeral Concourse cluster with `docker-compose`.
|
15
28
|
|
16
29
|
|
17
|
-
##
|
30
|
+
## v0.24.0 / 2019-01-24
|
18
31
|
|
19
32
|
### Features
|
20
33
|
|
@@ -27,14 +40,14 @@
|
|
27
40
|
* `#erbify` has been removed in favor of `#erbify_file`
|
28
41
|
|
29
42
|
|
30
|
-
##
|
43
|
+
## v0.23.0 / 2019-01-19
|
31
44
|
|
32
45
|
### Features
|
33
46
|
|
34
47
|
* Support for multiple pipelines.
|
35
48
|
|
36
49
|
|
37
|
-
##
|
50
|
+
## v0.22.0 / 2019-01-18
|
38
51
|
|
39
52
|
### Breaking changes
|
40
53
|
|
@@ -49,18 +62,18 @@
|
|
49
62
|
* `Concourse.new` now takes an optional `:secrets_filename` named param to set the name of the private variable file used. [#1] (Thanks, @ebmeierj!)
|
50
63
|
|
51
64
|
|
52
|
-
##
|
65
|
+
## v0.21.0 / 2018-12-26
|
53
66
|
|
54
67
|
* Introduce ruby 2.6 final (and remove 2.6-rc)
|
55
68
|
|
56
69
|
|
57
|
-
##
|
70
|
+
## v0.20.0 / 2018-11-09
|
58
71
|
|
59
72
|
* Introduce ruby 2.6-rc
|
60
73
|
* Introduce helper methods `production_rubies` and `rc_rubies`
|
61
74
|
|
62
75
|
|
63
|
-
##
|
76
|
+
## v0.19.0 / 2018-09-15
|
64
77
|
|
65
78
|
Several version of Ruby have reached EOL and have been removed from `RUBIES`:
|
66
79
|
|
@@ -69,41 +82,41 @@ Several version of Ruby have reached EOL and have been removed from `RUBIES`:
|
|
69
82
|
- jruby 1.7: https://github.com/jruby/jruby/issues/4112
|
70
83
|
|
71
84
|
|
72
|
-
##
|
85
|
+
## v0.18.0 / 2018-02-18
|
73
86
|
|
74
87
|
* Better default for `input` args to `concourse:task`: use the local directory for all the inputs. This matches the pattern where two different resources are used for ci scripts and the source under test.
|
75
88
|
|
76
89
|
|
77
|
-
##
|
90
|
+
## v0.17.0 / 2017-09-24
|
78
91
|
|
79
92
|
* Add support for Ruby 2.5 (in general and on Windows)
|
80
93
|
* Remove `fly` `-x` argument to work with Concourse 3.7.0+
|
81
94
|
|
82
95
|
|
83
|
-
##
|
96
|
+
## v0.16.0 / 2017-09-24
|
84
97
|
|
85
98
|
Bugfix: require "tempfile", we've been relying on the class being implicitly loaded
|
86
99
|
|
87
100
|
|
88
|
-
##
|
101
|
+
## v0.15.0 / 2017-09-24
|
89
102
|
|
90
103
|
* Add awareness of Windows Rubies (implicitly linked with https://github.com/flavorjones/windows-ruby-dev-tools-release)
|
91
104
|
|
92
105
|
|
93
|
-
##
|
106
|
+
## v0.14.0 / 2017-04-23
|
94
107
|
|
95
108
|
* Removed badge functionality. IMHO: too complicated, not useful
|
96
109
|
* Restoring support for Ruby 1.9 (for JRuby 1.7), ugh.
|
97
110
|
|
98
111
|
|
99
|
-
##
|
112
|
+
## v0.13.0 / 2017-03-23
|
100
113
|
|
101
114
|
### Features
|
102
115
|
|
103
116
|
* allow setting of concourse directory name
|
104
117
|
|
105
118
|
|
106
|
-
##
|
119
|
+
## v0.12.0 / 2017-02-14
|
107
120
|
|
108
121
|
### Features
|
109
122
|
|
@@ -114,56 +127,56 @@ Bugfix: require "tempfile", we've been relying on the class being implicitly loa
|
|
114
127
|
* properly require 'yaml'
|
115
128
|
|
116
129
|
|
117
|
-
##
|
130
|
+
## v0.11.0 / 2017-02-14
|
118
131
|
|
119
132
|
Stop using `myproject.yml.erb` and just interpret `myproject.yml` as an ERB template. @jtarchie was right. He's always right.
|
120
133
|
|
121
134
|
|
122
|
-
##
|
135
|
+
## v0.10.0 / 2017-02-08
|
123
136
|
|
124
137
|
Add `destroy` and `abort-builds` tasks.
|
125
138
|
|
126
139
|
|
127
|
-
##
|
140
|
+
## v0.9.0 / 2017-02-08
|
128
141
|
|
129
142
|
Bugfix: run `fly execute` with a clean Bundler environment, to avoid accidentally injecting our environment variables into the running task.
|
130
143
|
|
131
144
|
|
132
|
-
##
|
145
|
+
## v0.8.0 / 2017-02-08
|
133
146
|
|
134
147
|
Expose `#erbify` and `#markdown_badge` methods.
|
135
148
|
|
136
149
|
|
137
|
-
##
|
150
|
+
## v0.7.0 / 2017-02-08
|
138
151
|
|
139
152
|
Added a rake task to generate badges markdown.
|
140
153
|
|
141
154
|
|
142
|
-
##
|
155
|
+
## v0.6.{0,1} / 2017-01-26
|
143
156
|
|
144
157
|
If it exists, use `concourse/private.yml` to fill in template values.
|
145
158
|
|
146
159
|
|
147
|
-
##
|
160
|
+
## v0.5.0 / 2017-01-23
|
148
161
|
|
149
162
|
Renamed the `concourse:tasks` task name arg, and improved the README.
|
150
163
|
|
151
164
|
|
152
|
-
##
|
165
|
+
## v0.4.0 / 2017-01-22
|
153
166
|
|
154
167
|
Now uses the project name as the `fly execute` input resource name.
|
155
168
|
|
156
169
|
|
157
|
-
##
|
170
|
+
## v0.3.0 / 2017-01-22
|
158
171
|
|
159
172
|
Avoid depending on `rake/clean`
|
160
173
|
|
161
174
|
|
162
|
-
##
|
175
|
+
## v0.2.0 / 2017-01-22
|
163
176
|
|
164
177
|
Always regenerate pipeline file.
|
165
178
|
|
166
179
|
|
167
|
-
##
|
180
|
+
## v0.1.0 / 2017-01-22
|
168
181
|
|
169
182
|
First release.
|
data/README.md
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
# concourse (the rubygem)
|
2
2
|
|
3
|
-
The `concourse` gem provides rake tasks to help you manage Concourse pipelines, jobs, and workers, to assist in running tasks with `fly execute`, and even run a local ephemeral deployment of Concourse on your development machine.
|
3
|
+
The `concourse` gem provides rake tasks to help you manage Concourse CI pipelines, jobs, and workers, to assist in running tasks with `fly execute`, and even run a local ephemeral deployment of Concourse on your development machine.
|
4
4
|
|
5
|
-
If you're not familiar with Concourse CI, you can read up on it at https://concourse.
|
5
|
+
If you're not familiar with Concourse CI, you can read up on it at https://concourse-ci.org
|
6
|
+
|
7
|
+
Here's an example pipeline maintained by this gem:
|
8
|
+
|
9
|
+
![nokogiri-master](assets/nokogiri-master-pipeline.png)
|
6
10
|
|
7
11
|
|
8
12
|
## Contents
|
@@ -15,6 +19,7 @@ If you're not familiar with Concourse CI, you can read up on it at https://conco
|
|
15
19
|
* [Install](#install)
|
16
20
|
* [Add to your `Rakefile`](#add-to-your-rakefile)
|
17
21
|
* [Set up your Concourse pipeline](#set-up-your-concourse-pipeline)
|
22
|
+
- [Real-world Examples](#real-world-examples)
|
18
23
|
- [Concourse pipeline configuration](#concourse-pipeline-configuration)
|
19
24
|
* [ERB Templating](#erb-templating)
|
20
25
|
* [`RUBIES`](#rubies)
|
@@ -78,6 +83,18 @@ The `concourse:init` task will do a few different things for you:
|
|
78
83
|
3. ensure git will ignore your secrets file named `private.yml` (or whatever you've configured with the `:secrets_filename` parameter)
|
79
84
|
|
80
85
|
|
86
|
+
## Real-world Examples
|
87
|
+
|
88
|
+
It might be helpful to look at how other projects are using this gem. Here are a sample, ordered (approximately) from simplest to most complex:
|
89
|
+
|
90
|
+
* [`jbarnette/hoe-debugging`](https://github.com/jbarnette/hoe-debugging) has [one pipeline](https://github.com/jbarnette/hoe-debugging/blob/master/concourse/hoe-debugging.yml) that test multiple versions of MRI. ([see it live](https://ci.nokogiri.org/teams/flavorjones/pipelines/hoe-debugging))
|
91
|
+
* [`flavorjones/hoe-gemspec`](https://github.com/flavorjones/hoe-gemspec) has [one pipeline](https://github.com/flavorjones/hoe-gemspec/blob/master/concourse/hoe-gemspec.yml) that test multiple versions of MRI __and JRuby__. ([see it live](https://ci.nokogiri.org/teams/flavorjones/pipelines/hoe-gemspec))
|
92
|
+
* [`flavorjones/calendar-assistant`](https://github.com/flavorjones/calendar-assistant) has [one pipeline](https://github.com/flavorjones/calendar-assistant/blob/master/concourse/calendar-assistant.yml) that runs tests against `master` __and pull-requests__, uses __secrets__, and __integrates with Slack__. ([see it live](https://ci.nokogiri.org/teams/calendar-assistants/pipelines/calendar-assistant))
|
93
|
+
* [`flavorjones/mini_portile`](https://github.com/flavorjones/mini_portile) has [one pipeline](https://github.com/flavorjones/mini_portile/blob/master/concourse/mini_portile.yml) that run tests on both Linux __and Windows__. ([see it live](https://ci.nokogiri.org/teams/nokogiri-core/pipelines/mini_portile))
|
94
|
+
* [`flavorjones/chromedriver-helper`](https://github.com/flavorjones/chromedriver-helper) has __two pipelines__ that test [master](https://github.com/flavorjones/chromedriver-helper/blob/master/concourse/chromedriver-helper.yml) and [pull requests](https://github.com/flavorjones/chromedriver-helper/blob/master/concourse/chromedriver-helper-pr.yml). (see [Rakefile](https://github.com/flavorjones/chromedriver-helper/blob/master/Rakefile#L9-L12) config) (see [master](https://ci.nokogiri.org/teams/flavorjones/pipelines/chromedriver-helper) and [PR](https://ci.nokogiri.org/teams/flavorjones/pipelines/chromedriver-helper-pr) pipelines live)
|
95
|
+
* [`sparklemotion/nokogiri`](https://github.com/sparklemotion/nokogiri) has [multiple pipelines](https://github.com/sparklemotion/nokogiri/blob/master/concourse/nokogiri.yml) that __use `require` and `erbify_file` to share common elements__, and __integrate with IRC__. (see [master](https://ci.nokogiri.org/teams/nokogiri-core/pipelines/nokogiri) and [PR](https://ci.nokogiri.org/teams/nokogiri-core/pipelines/nokogiri-pr) pipelines live)
|
96
|
+
|
97
|
+
|
81
98
|
## Concourse pipeline configuration
|
82
99
|
|
83
100
|
### ERB Templating
|
@@ -110,10 +127,10 @@ The ruby variable `RUBIES` is defined in the ERB binding during pipeline file ge
|
|
110
127
|
``` ruby
|
111
128
|
# these numbers/names align with public docker image names
|
112
129
|
RUBIES = {
|
113
|
-
mri: %w[2.
|
114
|
-
jruby: %w[1
|
115
|
-
rbx: %w[latest],
|
116
|
-
windows: %w[2.3 2.4]
|
130
|
+
mri: %w[2.3 2.4 2.5 2.6], # docker repository: "ruby"
|
131
|
+
jruby: %w[9.1 9.2], # docker repository: "jruby"
|
132
|
+
rbx: %w[latest], # docker repository: "rubinius/docker"
|
133
|
+
windows: %w[2.3 2.4 2.5 2.6] # windows-ruby-dev-tools-release
|
117
134
|
}
|
118
135
|
```
|
119
136
|
|
@@ -122,14 +139,18 @@ and allows you to write a pipeline like this to get coverage on all the supporte
|
|
122
139
|
``` yaml
|
123
140
|
# myproject.yml
|
124
141
|
jobs:
|
125
|
-
|
142
|
+
% RUBIES[:mri].each do |ruby_version|
|
126
143
|
- name: "ruby-<%= ruby_version %>"
|
127
144
|
plan:
|
128
|
-
|
129
|
-
trigger: true
|
145
|
+
...
|
130
146
|
- task: rake-test
|
147
|
+
config:
|
148
|
+
platform: linux
|
149
|
+
image_resource:
|
150
|
+
type: docker-image
|
151
|
+
source: {repository: "ruby", tag: "<%= ruby_version %>"}
|
131
152
|
...
|
132
|
-
|
153
|
+
% end
|
133
154
|
```
|
134
155
|
|
135
156
|
Note that the `windows` rubies are not Docker images, since Concourse's Houdini backend doesn't use Docker. Instead, these are implicitly referring to the supported ruby versions installed by the BOSH release at https://github.com/flavorjones/windows-ruby-dev-tools-release
|
Binary file
|
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:
|
15
|
-
jruby:
|
16
|
-
rbx:
|
17
|
-
windows: %w[2.3 2.4 2.5 2.6] # windows-ruby-dev-tools-release
|
14
|
+
mri: %w[2.3 2.4 2.5 2.6], # docker repository: "ruby"
|
15
|
+
jruby: %w[9.1 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"
|
@@ -29,13 +29,13 @@ class Concourse
|
|
29
29
|
|
30
30
|
CONCOURSE_DOCKER_COMPOSE = "docker-compose.yml"
|
31
31
|
|
32
|
-
def self.url_for
|
32
|
+
def self.url_for(fly_target)
|
33
33
|
matching_line = `fly targets`.split("\n").grep(/^#{fly_target}/).first
|
34
34
|
raise "invalid fly target #{fly_target}" unless matching_line
|
35
35
|
matching_line.split(/ +/)[1]
|
36
36
|
end
|
37
37
|
|
38
|
-
def self.default_execute_args
|
38
|
+
def self.default_execute_args(task)
|
39
39
|
args = []
|
40
40
|
task["config"]["inputs"].each do |input|
|
41
41
|
args << "--input=#{input["name"]}=."
|
@@ -51,7 +51,7 @@ class Concourse
|
|
51
51
|
RUBIES[:mri].select { |r| r =~ /rc/ }
|
52
52
|
end
|
53
53
|
|
54
|
-
def initialize
|
54
|
+
def initialize(project_name, options = {}, &block)
|
55
55
|
@project_name = project_name
|
56
56
|
|
57
57
|
@directory = options[:directory] || DEFAULT_DIRECTORY
|
@@ -69,11 +69,11 @@ class Concourse
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
|
-
def add_pipeline
|
72
|
+
def add_pipeline(name, erb_filename)
|
73
73
|
@pipelines << Concourse::Pipeline.new(name, @directory, erb_filename)
|
74
74
|
end
|
75
75
|
|
76
|
-
def pipeline_subcommands
|
76
|
+
def pipeline_subcommands(command)
|
77
77
|
pipelines.collect { |p| "#{command}:#{p.name}" }
|
78
78
|
end
|
79
79
|
|
@@ -85,19 +85,13 @@ class Concourse
|
|
85
85
|
ensure_in_gitignore secrets_filename
|
86
86
|
end
|
87
87
|
|
88
|
-
def rake_pipeline_generate
|
88
|
+
def rake_pipeline_generate(pipeline)
|
89
89
|
File.open pipeline.filename, "w" do |f|
|
90
90
|
f.write erbify_file(pipeline.erb_filename, working_directory: directory)
|
91
91
|
end
|
92
92
|
fly "validate-pipeline -c #{pipeline.filename}"
|
93
93
|
end
|
94
94
|
|
95
|
-
def rake_concourse_local
|
96
|
-
ensure_docker_compose_file
|
97
|
-
@fly_target = "local"
|
98
|
-
fly "login -u test -p test -c http://127.0.0.1:8080"
|
99
|
-
end
|
100
|
-
|
101
95
|
def ensure_docker_compose_file
|
102
96
|
return if File.exist?(docker_compose_path)
|
103
97
|
note "fetching docker compose file ..."
|
@@ -106,6 +100,12 @@ class Concourse
|
|
106
100
|
end
|
107
101
|
end
|
108
102
|
|
103
|
+
def rake_concourse_local
|
104
|
+
ensure_docker_compose_file
|
105
|
+
@fly_target = "local"
|
106
|
+
fly "login -u test -p test -c http://127.0.0.1:8080"
|
107
|
+
end
|
108
|
+
|
109
109
|
def rake_concourse_local_up
|
110
110
|
ensure_docker_compose_file
|
111
111
|
docker_compose "up -d"
|
@@ -210,7 +210,7 @@ class Concourse
|
|
210
210
|
task "task", [:job_task, :fly_execute_args] => "generate" do |t, args|
|
211
211
|
job_task = args[:job_task]
|
212
212
|
unless job_task
|
213
|
-
raise "ERROR: must specify a task name, like `rake #{t.name}[
|
213
|
+
raise "ERROR: must specify a task name, like `rake #{t.name}[taskname]`"
|
214
214
|
end
|
215
215
|
|
216
216
|
concourse_task = find_task(job_task)
|
@@ -218,7 +218,13 @@ class Concourse
|
|
218
218
|
|
219
219
|
fly_execute_args = args[:fly_execute_args] || Concourse.default_execute_args(concourse_task)
|
220
220
|
|
221
|
+
if File.exist? secrets_filename
|
222
|
+
note "using #{secrets_filename} to resolve template vars"
|
223
|
+
fly_execute_args += " -l '#{secrets_filename}'"
|
224
|
+
end
|
225
|
+
|
221
226
|
puts concourse_task.to_yaml
|
227
|
+
|
222
228
|
Tempfile.create("concourse-task") do |f|
|
223
229
|
f.write concourse_task["config"].to_yaml
|
224
230
|
f.close
|
@@ -234,7 +240,7 @@ class Concourse
|
|
234
240
|
desc "abort all running builds for this concourse team"
|
235
241
|
task "abort-builds" do |t, args|
|
236
242
|
`fly -t #{fly_target} builds`.each_line do |line|
|
237
|
-
pipeline_job, build_id, status = *line.split(/\s+/)[1,3]
|
243
|
+
pipeline_job, build_id, status = *line.split(/\s+/)[1, 3]
|
238
244
|
next unless status == "started"
|
239
245
|
|
240
246
|
fly "abort-build -j #{pipeline_job} -b #{build_id}"
|
@@ -255,6 +261,7 @@ class Concourse
|
|
255
261
|
#
|
256
262
|
# docker commands
|
257
263
|
#
|
264
|
+
desc "set fly target to the local docker-compose cluster"
|
258
265
|
task "local" do
|
259
266
|
rake_concourse_local
|
260
267
|
end
|
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.27.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: 2019-
|
11
|
+
date: 2019-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: term-ansicolor
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- LICENSE.txt
|
83
83
|
- README.md
|
84
84
|
- Rakefile
|
85
|
+
- assets/nokogiri-master-pipeline.png
|
85
86
|
- concourse.gemspec
|
86
87
|
- lib/concourse.rb
|
87
88
|
- lib/concourse/pipeline.rb
|
@@ -106,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
107
|
- !ruby/object:Gem::Version
|
107
108
|
version: '0'
|
108
109
|
requirements: []
|
109
|
-
rubygems_version: 3.0.
|
110
|
+
rubygems_version: 3.0.3
|
110
111
|
signing_key:
|
111
112
|
specification_version: 4
|
112
113
|
summary: Rake tasks for Concourse pipelines.
|