concourse 0.4.0 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ee85690e2cce2d85793daef276bdeb5414374e88
4
- data.tar.gz: 39aedca58ff45e15261c79338eb865762db466f0
3
+ metadata.gz: cb83feeb6f40bcd3a194cb889cd7e8e65f43ff64
4
+ data.tar.gz: 424a8885d44e16eea6e702237f98cbdb5c55e041
5
5
  SHA512:
6
- metadata.gz: 7b538ca79abc181a43f5d0b9e6cfa81a867ca6ebbff301b3679222f90301ce9360a9c958686d7b1dcdfb010eb80fac87c61fe6a52293000833c0fd4feb36d84f
7
- data.tar.gz: 54e97a66e38414343ee06b6cd2c6896d2ba58bfca504e67de7c1cfc0418b4e0d4b9cd5526c164b8252974dde51f5b24e2b778927ef4219575d73358f58e97842
6
+ metadata.gz: 3d90b8f93734761e7241823c9375328f3126a21a6784772308c32305650030754fbc952f4f2cb32143c2207c8b2c54d468d9b8bcd1388f7253661ad23679f199
7
+ data.tar.gz: 43d44fcaa6c2af3d5c879aeb46473a1997698bd19653c6d2c12f48dda0e179b7e8eef8b43a5defc9480d2d39d19fa62f2db56874a9a811f6564d65bbf00f905d
@@ -1,5 +1,20 @@
1
1
  # concourse-gem changelog
2
2
 
3
+ ## 0.5.0 / 2017-01-23
4
+
5
+ Renamed the `concourse:tasks` task name arg, and improved the README.
6
+
7
+
8
+ ## 0.4.0 / 2017-01-22
9
+
10
+ Now uses the project name as the `fly execute` input resource name.
11
+
12
+
13
+ ## 0.3.0 / 2017-01-22
14
+
15
+ Avoid depending on `rake/clean`
16
+
17
+
3
18
  ## 0.2.0 / 2017-01-22
4
19
 
5
20
  Always regenerate pipeline file.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Concourse
2
2
 
3
- The `Concourse` gem creates rake tasks to help you manage your Concourse pipelines, and to assist in running individual tasks on your local development machine.
3
+ The `Concourse` gem provides rake tasks to help you manage your Concourse pipelines, and to assist in running individual tasks with `fly execute`.
4
4
 
5
5
  If you're not familiar with Concourse CI, you can read up on it at https://concourse.ci
6
6
 
@@ -17,6 +17,42 @@ Concourse.new("myproject").create_tasks!
17
17
 
18
18
  This will create a set of rake tasks for you.
19
19
 
20
+ Create a subdirectory named `concourse`, and edit a Concourse pipeline template named `myproject.yml.erb`.
21
+
22
+
23
+ ### Templating and `RUBIES`
24
+
25
+ The ruby variable `RUBIES` is defined in the ERB binding during pipeline file generation. This variable looks like:
26
+
27
+ ``` ruby
28
+ # these numbers/names align with public docker image names
29
+ RUBIES = {
30
+ mri: %w[2.1 2.2 2.3 2.4], # docker repository: "ruby"
31
+ jruby: %w[1.7 9.1], # docker repository: "jruby"
32
+ rbx: %w[latest], # docker repository: "rubinius/docker"
33
+ }
34
+ ```
35
+
36
+ and allows you to write a pipeline like this to get coverage on all the supported rubies:
37
+
38
+ ``` yaml
39
+ # myproject.yaml.erb
40
+ jobs:
41
+ <% for ruby_version in RUBIES[:mri] %>
42
+ - name: "ruby-<%= ruby_version %>"
43
+ plan:
44
+ - get: git-master
45
+ trigger: true
46
+ - task: rake-test
47
+ ...
48
+ <% end %>
49
+ ```
50
+
51
+
52
+ ### `fly_target`
53
+
54
+ Any rake task that needs to interact with your Concourse ATC requires a `fly_target` argument. The value should be a fly target `name`, and it's assumed that you're already logged in to that target.
55
+
20
56
 
21
57
  ### Managing your Concourse pipeline
22
58
 
@@ -27,7 +63,7 @@ rake concourse:clean # remove generate pipeline file
27
63
  rake concourse:generate # generate and validate the pipeline file for myproject
28
64
  ```
29
65
 
30
- A task to upload your pipeline file to the cloud:
66
+ A task to update your pipeline configuration:
31
67
 
32
68
  ```
33
69
  rake concourse:set[fly_target] # upload the pipeline file for myproject
@@ -47,49 +83,18 @@ rake concourse:pause[fly_target] # pause the myproject pipeline
47
83
  rake concourse:unpause[fly_target] # unpause the myproject pipeline
48
84
  ```
49
85
 
86
+
50
87
  ### Running tasks with `fly execute`
51
88
 
52
89
  ```
53
- rake concourse:tasks # list all the available tasks from the nokogiri pipeline
54
- rake concourse:task[fly_target,task_name,fly_execute_args] # fly execute the specified task
55
- ```
56
-
57
- where `fly_execute_args` will default to use the project name, e.g. `--input=myproject=.`, so your pipeline should name the input resource appropriately.
58
-
59
-
60
-
61
- ### `fly_target`
62
-
63
- The `fly_target` argument should be a fly target `name`, and the rake tasks assume that you're logged in already to that target.
64
-
65
-
66
- ### Templating and `RUBIES`
67
-
68
- The ruby variable `RUBIES` is defined during the context of pipeline generation. The structure is something like:
69
-
70
- ``` ruby
71
- # these numbers/names align with public docker image names
72
- RUBIES = {
73
- mri: %w[2.1 2.2 2.3 2.4], # docker repository: "ruby"
74
- jruby: %w[1.7 9.1], # docker repository: "jruby"
75
- rbx: %w[latest], # docker repository: "rubinius/docker"
76
- }
90
+ rake concourse:tasks # list all the available tasks from the nokogiri pipeline
91
+ rake concourse:task[fly_target,job_task,fly_execute_args] # fly execute the specified task
77
92
  ```
78
93
 
79
- and allows you to write your pipeline like this to get coverage on all the supported rubies:
94
+ where:
80
95
 
81
- ``` yaml
82
- # myproject.yaml.erb
83
- jobs:
84
- <% for ruby_version in RUBIES[:mri] %>
85
- - name: "ruby-<%= ruby_version %>"
86
- plan:
87
- - get: git-master
88
- trigger: true
89
- - task: rake-test
90
- ...
91
- <% end %>
92
- ```
96
+ * _required_: `job_task` is formatted as `job-name/task-name`, for example, `ruby-2.4/rake-test`. Run the `concourse:tasks` rake task to see all available names.
97
+ * _optional_: `fly_execute_args` will default to map the project directory to a resource with the project name, e.g. `--input=myproject=.`, so your pipeline must name the input resource appropriately in order to use the default.
93
98
 
94
99
 
95
100
  ## Installation
@@ -81,21 +81,21 @@ class Concourse
81
81
  end
82
82
 
83
83
  puts "Available Concourse tasks for #{project_name} are:"
84
- tasks.each { |task| puts " * #{task}" }
84
+ tasks.sort.each { |task| puts " * #{task}" }
85
85
  end
86
86
 
87
87
  desc "fly execute the specified task"
88
- task "task", [:fly_target, :task_name, :fly_execute_args] => "generate" do |t, args|
88
+ task "task", [:fly_target, :job_task, :fly_execute_args] => "generate" do |t, args|
89
89
  fly_target = Concourse.validate_fly_target t, args
90
- task_name = args[:task_name]
90
+ job_task = args[:job_task]
91
91
  fly_execute_args = args[:fly_execute_args] || "--input=#{project_name}=."
92
92
 
93
- unless task_name
93
+ unless job_task
94
94
  raise "ERROR: must specify a task name, like `rake #{t.name}[target,taskname]`"
95
95
  end
96
96
 
97
- concourse_task = find_task task_name
98
- raise "ERROR: could not find task `#{task_name}`" unless concourse_task
97
+ concourse_task = find_task job_task
98
+ raise "ERROR: could not find task `#{job_task}`" unless concourse_task
99
99
 
100
100
  puts concourse_task.to_yaml
101
101
  Tempfile.create do |f|
@@ -117,8 +117,8 @@ class Concourse
117
117
  end
118
118
  end
119
119
 
120
- def find_task task_name
121
- job_name, task_name = *task_name.split("/")
120
+ def find_task job_task
121
+ job_name, task_name = *job_task.split("/")
122
122
  each_task do |job, task|
123
123
  return task if task["task"] == task_name && job["name"] == job_name
124
124
  end
@@ -2,5 +2,5 @@ require "rake"
2
2
  require "erb"
3
3
 
4
4
  class Concourse
5
- VERSION = "0.4.0"
5
+ VERSION = "0.5.0"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concourse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Dalessio