rake_fly 2.3.0 → 2.4.0.pre.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f64b2459e19b0db9b194647d96f620583be4ac39c8607557ae54c345c826132
4
- data.tar.gz: f8f6737ef17bf9ebe9306f1eb458ca35e8ac7139d8eda6a10e908f2878de82ef
3
+ metadata.gz: c6d5cd3c8a380713e13705acd563c9c8c00622428e2e59e0fb6c38cf6eba74d6
4
+ data.tar.gz: 40fc78d21ba5d9b89fd81fac2f0e682156532cbc4cc251e9ddf587efc0c0882b
5
5
  SHA512:
6
- metadata.gz: 871493e578de86b5bf49b0c7123f8cdaea12dc191f55610b2151bbed2fdfbcb0442fe89253198b5b1f999ae58c7826f6b3022d749c4dc2f969561e76219e77c5
7
- data.tar.gz: bff4068967ee0809f0b5f947d5e645b38546418b3e0632650e341aea21c23f54cd469c3376cc394ca9b550d0827c1df7270be1393ba2a86f0ecbd185958f3945
6
+ metadata.gz: 9ba8c9fd41517ed6d8dbd750c3e92f69c38e59c1beb5e879b34f611364d0386477a3df0ce0f9a3011702da3a75e115a8588b4b486e19a4320beef95610091f76
7
+ data.tar.gz: 36fa5178f20dd934b248f11fb537b6a0ae74f8e10a95b9db985165b5a817f448c5dd0710e67b7857ae79cc8aa3d0927f18b06062c17604c860f5692136226b66
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rake_fly (2.3.0)
4
+ rake_fly (2.4.0.pre.1)
5
5
  concourse.rb (>= 0.4)
6
6
  rake_dependencies (~> 2, < 3)
7
7
  rake_factory (>= 0.29, < 1)
@@ -47,12 +47,16 @@ module RakeFly
47
47
  RakeDependencies::TaskSets::All.define(task_set_opts)
48
48
  end
49
49
 
50
+ def self.define_authentication_tasks(opts = {}, &block)
51
+ RakeFly::TaskSets::Authentication.define(opts, &block)
52
+ end
53
+
50
54
  def self.define_pipeline_tasks(opts = {}, &block)
51
55
  RakeFly::TaskSets::Pipeline.define(opts, &block)
52
56
  end
53
57
 
54
- def self.define_authentication_tasks(opts = {}, &block)
55
- RakeFly::TaskSets::Authentication.define(opts, &block)
58
+ def self.define_project_tasks(opts = {}, &block)
59
+ RakeFly::TaskSets::Project.define(opts, &block)
56
60
  end
57
61
 
58
62
  private
@@ -1,2 +1,3 @@
1
- require_relative 'task_sets/pipeline'
2
1
  require_relative 'task_sets/authentication'
2
+ require_relative 'task_sets/pipeline'
3
+ require_relative 'task_sets/project'
@@ -0,0 +1,124 @@
1
+ require 'rake_factory'
2
+
3
+ require_relative '../tasks/authentication/login'
4
+ require_relative '../tasks/authentication/ensure'
5
+ require_relative '../tasks/pipeline/get'
6
+ require_relative '../tasks/pipeline/set'
7
+ require_relative '../tasks/pipeline/unpause'
8
+ require_relative '../tasks/pipeline/push'
9
+
10
+ module RakeFly
11
+ module TaskSets
12
+ class Project < RakeFactory::TaskSet
13
+ prepend RakeFactory::Namespaceable
14
+
15
+ parameter :argument_names, default: []
16
+
17
+ parameter :concourse_url, required: true
18
+ parameter :team, default: 'main'
19
+ parameter :username
20
+ parameter :password
21
+
22
+ parameter :pipeline, required: true
23
+ parameter :config, required: true
24
+
25
+ parameter :vars
26
+ parameter :var_files
27
+ parameter :non_interactive
28
+
29
+ parameter :target,
30
+ default: RakeFactory::DynamicValue.new { |t| t.team }
31
+
32
+ parameter :home_directory,
33
+ default: RakeFactory::DynamicValue.new { |_| ENV['HOME'] }
34
+
35
+ parameter :authentication_namespace, default: :authentication
36
+ parameter :authentication_login_task_name, default: :login
37
+ parameter :authentication_ensure_task_name, default: :ensure
38
+
39
+ parameter :pipeline_namespace, default: :pipeline
40
+ parameter :pipeline_get_task_name, default: :get
41
+ parameter :pipeline_set_task_name, default: :set
42
+ parameter :pipeline_unpause_task_name, default: :unpause
43
+ parameter :pipeline_push_task_name, default: :push
44
+
45
+ parameter :fly_ensure_task_name, default: :'fly:ensure'
46
+
47
+ task Tasks::Authentication::Login,
48
+ name: RakeFactory::DynamicValue.new { |ts|
49
+ ts.authentication_login_task_name
50
+ }
51
+ task Tasks::Authentication::Ensure,
52
+ name: RakeFactory::DynamicValue.new { |ts|
53
+ ts.authentication_ensure_task_name
54
+ },
55
+ login_task_name: RakeFactory::DynamicValue.new { |ts|
56
+ ts.authentication_login_task_name
57
+ }
58
+
59
+ task Tasks::Pipeline::Get,
60
+ name: RakeFactory::DynamicValue.new { |ts|
61
+ ts.pipeline_get_task_name
62
+ },
63
+ authentication_ensure_task_name: RakeFactory::DynamicValue.new { |ts|
64
+ (ts.authentication_namespace.to_s + ":" +
65
+ ts.authentication_ensure_task_name.to_s)
66
+ .to_sym
67
+ }
68
+ task Tasks::Pipeline::Set,
69
+ name: RakeFactory::DynamicValue.new { |ts|
70
+ ts.pipeline_set_task_name
71
+ },
72
+ authentication_ensure_task_name: RakeFactory::DynamicValue.new { |ts|
73
+ (ts.authentication_namespace.to_s + ":" +
74
+ ts.authentication_ensure_task_name.to_s)
75
+ .to_sym
76
+ }
77
+ task Tasks::Pipeline::Unpause,
78
+ name: RakeFactory::DynamicValue.new { |ts|
79
+ ts.pipeline_unpause_task_name
80
+ },
81
+ authentication_ensure_task_name: RakeFactory::DynamicValue.new { |ts|
82
+ (ts.authentication_namespace.to_s + ":" +
83
+ ts.authentication_ensure_task_name.to_s)
84
+ .to_sym
85
+ }
86
+ task Tasks::Pipeline::Push,
87
+ name: RakeFactory::DynamicValue.new { |ts|
88
+ ts.pipeline_push_task_name
89
+ },
90
+ get_task_name: RakeFactory::DynamicValue.new { |ts|
91
+ ts.pipeline_get_task_name
92
+ },
93
+ set_task_name: RakeFactory::DynamicValue.new { |ts|
94
+ ts.pipeline_set_task_name
95
+ },
96
+ unpause_task_name: RakeFactory::DynamicValue.new { |ts|
97
+ ts.pipeline_unpause_task_name
98
+ }
99
+
100
+ def define_on(application)
101
+ around_define(application) do
102
+ self.class.tasks.each do |task_definition|
103
+ task_class = task_definition.klass.to_s
104
+ ns = case task_class
105
+ when /Pipeline/
106
+ pipeline_namespace
107
+ when /Authentication/
108
+ authentication_namespace
109
+ else
110
+ raise StandardError.new(
111
+ "Unexpected task definition: #{task_class}.")
112
+ end
113
+
114
+ application.in_namespace(ns) do
115
+ task_definition
116
+ .for_task_set(self)
117
+ .define_on(application)
118
+ end
119
+ end
120
+ end
121
+ end
122
+ end
123
+ end
124
+ end
@@ -21,6 +21,8 @@ module RakeFly
21
21
  parameter :home_directory,
22
22
  default: RakeFactory::DynamicValue.new { |_| ENV['HOME'] }
23
23
 
24
+ parameter :login_task_name, :default => :login
25
+
24
26
  parameter :fly_ensure_task_name, :default => :'fly:ensure'
25
27
 
26
28
  action do |t, args|
@@ -34,7 +36,7 @@ module RakeFly
34
36
  puts "Already logged in. Continuing..."
35
37
  else
36
38
  puts "Not logged in. Logging in..."
37
- t.application[:login, t.scope].invoke(*args)
39
+ t.application[t.login_task_name, t.scope].invoke(*args)
38
40
  end
39
41
  end
40
42
  end
@@ -1,3 +1,3 @@
1
1
  module RakeFly
2
- VERSION = '2.3.0'
2
+ VERSION = '2.4.0.pre.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake_fly
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.4.0.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toby Clemson
@@ -309,6 +309,7 @@ files:
309
309
  - lib/rake_fly/task_sets.rb
310
310
  - lib/rake_fly/task_sets/authentication.rb
311
311
  - lib/rake_fly/task_sets/pipeline.rb
312
+ - lib/rake_fly/task_sets/project.rb
312
313
  - lib/rake_fly/tasks.rb
313
314
  - lib/rake_fly/tasks/authentication/ensure.rb
314
315
  - lib/rake_fly/tasks/authentication/login.rb
@@ -332,9 +333,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
332
333
  version: '2.6'
333
334
  required_rubygems_version: !ruby/object:Gem::Requirement
334
335
  requirements:
335
- - - ">="
336
+ - - ">"
336
337
  - !ruby/object:Gem::Version
337
- version: '0'
338
+ version: 1.3.1
338
339
  requirements: []
339
340
  rubygems_version: 3.0.1
340
341
  signing_key: