rake_fly 2.2.0.pre.7 → 2.6.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: afb1b3a4898cc6ec6a31aa66e6676c848c3db0a61f1339da535d16e4520323ae
4
- data.tar.gz: 86186bf53bfd095a8fa3b9f9a5733f1de176429602a3ceaeacb5aa8cbac4d757
3
+ metadata.gz: ed8cc98dcf4d5767c0b1c02812d9a3731bd6cd458e9f1c4ef5a2d72d1d3d6892
4
+ data.tar.gz: e9a3c25e1eb48e7118d2c57e533c18c2d3b881361e819e31c158773dab19dd63
5
5
  SHA512:
6
- metadata.gz: a6fb482d84fb6ca94580a009652e26df0c327b5a9fa43094f22eebd388028c85c804840b1ac0d5bf170b33d32ee85e641971852da7e5646ced381cac7c0c8338
7
- data.tar.gz: 18dd7843beb8ecc31d1c570babbf09beb71b62d546b85cafec6299366f7ede5ad2f676f7e6af9138884af3108d0fb6cb11e07e14d48d7fd599cb35b03b1e5b52
6
+ metadata.gz: f6fb485ebeb5f973b9a271bcddfbb424c240d23b385cc525efe427291da303bfa0d3608466b55771917a1ecc0e756c42d9cd0e327874f9e0491a50ceeb0d71a7
7
+ data.tar.gz: 9b8ef0f149ba50e18109d8f642b1e739c976d94493e853497f4f993c073135595d314f2717d375b7d051d5eae925a701c5240f01b7dd87e677c703b72a75a1ea
@@ -1,17 +1,17 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rake_fly (2.2.0.pre.7)
4
+ rake_fly (2.6.0.pre.1)
5
5
  concourse.rb (>= 0.4)
6
6
  rake_dependencies (~> 2, < 3)
7
7
  rake_factory (>= 0.29, < 1)
8
- ruby_fly (>= 0.31)
8
+ ruby_fly (>= 0.35)
9
9
  semantic (~> 1.6.1)
10
10
 
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- activesupport (6.1.0)
14
+ activesupport (6.1.1)
15
15
  concurrent-ruby (~> 1.0, >= 1.0.2)
16
16
  i18n (>= 1.6, < 2)
17
17
  minitest (>= 5.1)
@@ -24,9 +24,9 @@ GEM
24
24
  dry-schema (~> 0.5)
25
25
  excon (~> 0.72)
26
26
  semantic (~> 1.5)
27
- concurrent-ruby (1.1.7)
27
+ concurrent-ruby (1.1.8)
28
28
  diff-lcs (1.4.4)
29
- docile (1.3.4)
29
+ docile (1.3.5)
30
30
  dry-configurable (0.12.0)
31
31
  concurrent-ruby (~> 1.0)
32
32
  dry-core (~> 0.5, >= 0.5.0)
@@ -49,11 +49,10 @@ GEM
49
49
  dry-initializer (~> 3.0)
50
50
  dry-logic (~> 1.0)
51
51
  dry-types (~> 1.0)
52
- dry-types (1.4.0)
52
+ dry-types (1.5.0)
53
53
  concurrent-ruby (~> 1.0)
54
54
  dry-container (~> 0.3)
55
- dry-core (~> 0.4, >= 0.4.4)
56
- dry-equalizer (~> 0.3)
55
+ dry-core (~> 0.5, >= 0.5)
57
56
  dry-inflector (~> 0.1, >= 0.1.2)
58
57
  dry-logic (~> 1.0, >= 1.0.2)
59
58
  excon (0.78.1)
@@ -64,8 +63,8 @@ GEM
64
63
  faraday-net_http (~> 1.0)
65
64
  multipart-post (>= 1.2, < 3)
66
65
  ruby2_keywords
67
- faraday-net_http (1.0.0)
68
- gem-release (2.2.0)
66
+ faraday-net_http (1.0.1)
67
+ gem-release (2.2.1)
69
68
  hamster (3.0.0)
70
69
  concurrent-ruby (~> 1.0)
71
70
  i18n (1.8.7)
@@ -75,7 +74,7 @@ GEM
75
74
  hamster (~> 3.0)
76
75
  open4 (~> 1.3)
77
76
  minitar (0.9)
78
- minitest (5.14.2)
77
+ minitest (5.14.3)
79
78
  multipart-post (2.1.1)
80
79
  octokit (4.20.0)
81
80
  faraday (>= 0.9)
@@ -122,8 +121,8 @@ GEM
122
121
  diff-lcs (>= 1.2.0, < 2.0)
123
122
  rspec-support (~> 3.10.0)
124
123
  rspec-support (3.10.1)
125
- ruby2_keywords (0.0.2)
126
- ruby_fly (0.31.0)
124
+ ruby2_keywords (0.0.4)
125
+ ruby_fly (0.35.0)
127
126
  lino (>= 1.5)
128
127
  ruby_gpg2 (0.8.0)
129
128
  lino (>= 1.5)
@@ -132,7 +131,7 @@ GEM
132
131
  addressable (>= 2.3.5)
133
132
  faraday (> 0.8, < 2.0)
134
133
  semantic (1.6.1)
135
- simplecov (0.21.1)
134
+ simplecov (0.21.2)
136
135
  docile (~> 1.1)
137
136
  simplecov-html (~> 0.11)
138
137
  simplecov_json_formatter (~> 0.1)
@@ -165,4 +164,4 @@ DEPENDENCIES
165
164
  simplecov (~> 0.16)
166
165
 
167
166
  BUNDLED WITH
168
- 2.2.4
167
+ 2.2.7
@@ -47,22 +47,18 @@ module RakeFly
47
47
  RakeDependencies::TaskSets::All.define(task_set_opts)
48
48
  end
49
49
 
50
- def self.define_pipeline_tasks(opts = {}, &block)
51
- task_names = opts[:task_names]
52
- if task_names
53
- opts[:get_pipeline_task_name] ||=
54
- task_names[:get_pipeline] if task_names[:get_pipeline]
55
- opts[:set_pipeline_task_name] ||=
56
- task_names[:set_pipeline] if task_names[:set_pipeline]
57
- opts[:unpause_pipeline_task_name] ||=
58
- task_names[:unpause_pipeline] if task_names[:unpause_pipeline]
59
- opts[:push_pipeline_task_name] ||=
60
- task_names[:push_pipeline] if task_names[:push_pipeline]
61
- end
50
+ def self.define_authentication_tasks(opts = {}, &block)
51
+ RakeFly::TaskSets::Authentication.define(opts, &block)
52
+ end
62
53
 
54
+ def self.define_pipeline_tasks(opts = {}, &block)
63
55
  RakeFly::TaskSets::Pipeline.define(opts, &block)
64
56
  end
65
57
 
58
+ def self.define_project_tasks(opts = {}, &block)
59
+ RakeFly::TaskSets::Project.define(opts, &block)
60
+ end
61
+
66
62
  private
67
63
 
68
64
  def self.new_format?(version)
@@ -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'
@@ -28,6 +28,7 @@ module RakeFly
28
28
  parameter :set_task_name, default: :set
29
29
  parameter :unpause_task_name, default: :unpause
30
30
  parameter :push_task_name, default: :push
31
+ parameter :destroy_task_name, default: :destroy
31
32
 
32
33
  parameter :fly_ensure_task_name, default: :'fly:ensure'
33
34
 
@@ -47,6 +48,10 @@ module RakeFly
47
48
  name: RakeFactory::DynamicValue.new { |ts|
48
49
  ts.push_task_name
49
50
  }
51
+ task Tasks::Pipeline::Destroy,
52
+ name: RakeFactory::DynamicValue.new { |ts|
53
+ ts.destroy_task_name
54
+ }
50
55
  end
51
56
  end
52
57
  end
@@ -0,0 +1,134 @@
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
+ parameter :pipeline_destroy_task_name, default: :destroy
45
+
46
+ parameter :fly_ensure_task_name, default: :'fly:ensure'
47
+
48
+ task Tasks::Authentication::Login,
49
+ name: RakeFactory::DynamicValue.new { |ts|
50
+ ts.authentication_login_task_name
51
+ }
52
+ task Tasks::Authentication::Ensure,
53
+ name: RakeFactory::DynamicValue.new { |ts|
54
+ ts.authentication_ensure_task_name
55
+ },
56
+ login_task_name: RakeFactory::DynamicValue.new { |ts|
57
+ ts.authentication_login_task_name
58
+ }
59
+
60
+ task Tasks::Pipeline::Get,
61
+ name: RakeFactory::DynamicValue.new { |ts|
62
+ ts.pipeline_get_task_name
63
+ },
64
+ authentication_ensure_task_name: RakeFactory::DynamicValue.new { |ts|
65
+ (ts.authentication_namespace.to_s + ":" +
66
+ ts.authentication_ensure_task_name.to_s)
67
+ .to_sym
68
+ }
69
+ task Tasks::Pipeline::Set,
70
+ name: RakeFactory::DynamicValue.new { |ts|
71
+ ts.pipeline_set_task_name
72
+ },
73
+ authentication_ensure_task_name: RakeFactory::DynamicValue.new { |ts|
74
+ (ts.authentication_namespace.to_s + ":" +
75
+ ts.authentication_ensure_task_name.to_s)
76
+ .to_sym
77
+ }
78
+ task Tasks::Pipeline::Unpause,
79
+ name: RakeFactory::DynamicValue.new { |ts|
80
+ ts.pipeline_unpause_task_name
81
+ },
82
+ authentication_ensure_task_name: RakeFactory::DynamicValue.new { |ts|
83
+ (ts.authentication_namespace.to_s + ":" +
84
+ ts.authentication_ensure_task_name.to_s)
85
+ .to_sym
86
+ }
87
+ task Tasks::Pipeline::Push,
88
+ name: RakeFactory::DynamicValue.new { |ts|
89
+ ts.pipeline_push_task_name
90
+ },
91
+ get_task_name: RakeFactory::DynamicValue.new { |ts|
92
+ ts.pipeline_get_task_name
93
+ },
94
+ set_task_name: RakeFactory::DynamicValue.new { |ts|
95
+ ts.pipeline_set_task_name
96
+ },
97
+ unpause_task_name: RakeFactory::DynamicValue.new { |ts|
98
+ ts.pipeline_unpause_task_name
99
+ }
100
+ task Tasks::Pipeline::Destroy,
101
+ name: RakeFactory::DynamicValue.new { |ts|
102
+ ts.pipeline_destroy_task_name
103
+ },
104
+ authentication_ensure_task_name: RakeFactory::DynamicValue.new { |ts|
105
+ (ts.authentication_namespace.to_s + ":" +
106
+ ts.authentication_ensure_task_name.to_s)
107
+ .to_sym
108
+ }
109
+
110
+ def define_on(application)
111
+ around_define(application) do
112
+ self.class.tasks.each do |task_definition|
113
+ task_class = task_definition.klass.to_s
114
+ ns = case task_class
115
+ when /Pipeline/
116
+ pipeline_namespace
117
+ when /Authentication/
118
+ authentication_namespace
119
+ else
120
+ raise StandardError.new(
121
+ "Unexpected task definition: #{task_class}.")
122
+ end
123
+
124
+ application.in_namespace(ns) do
125
+ task_definition
126
+ .for_task_set(self)
127
+ .define_on(application)
128
+ end
129
+ end
130
+ end
131
+ end
132
+ end
133
+ end
134
+ end
@@ -4,3 +4,4 @@ require_relative 'tasks/pipeline/get'
4
4
  require_relative 'tasks/pipeline/set'
5
5
  require_relative 'tasks/pipeline/unpause'
6
6
  require_relative 'tasks/pipeline/push'
7
+ require_relative 'tasks/pipeline/destroy'
@@ -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
@@ -0,0 +1,46 @@
1
+ require 'ruby_fly'
2
+ require 'rake_factory'
3
+
4
+ module RakeFly
5
+ module Tasks
6
+ module Pipeline
7
+ class Destroy < RakeFactory::Task
8
+ default_name :destroy
9
+ default_prerequisites RakeFactory::DynamicValue.new { |t|
10
+ [t.fly_ensure_task_name, t.authentication_ensure_task_name]
11
+ }
12
+ default_description RakeFactory::DynamicValue.new { |t|
13
+ pipeline = t.pipeline || '<derived>'
14
+ target = t.target || '<derived>'
15
+
16
+ "Destroy pipeline #{pipeline} for target #{target}"
17
+ }
18
+
19
+ parameter :target, :required => true
20
+ parameter :team
21
+ parameter :pipeline, :required => true
22
+
23
+ parameter :non_interactive
24
+
25
+ parameter :home_directory,
26
+ default: RakeFactory::DynamicValue.new { |_| ENV['HOME'] }
27
+
28
+ parameter :fly_ensure_task_name, :default => :'fly:ensure'
29
+ parameter :authentication_ensure_task_name,
30
+ :default => :'authentication:ensure'
31
+
32
+ action do |t|
33
+ puts "Destroying pipeline #{t.pipeline} for target #{t.target}..."
34
+ RubyFly.destroy_pipeline(
35
+ target: t.target,
36
+ team: t.team,
37
+ pipeline: t.pipeline,
38
+ non_interactive: t.non_interactive,
39
+ environment: {
40
+ "HOME" => t.home_directory
41
+ })
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -1,3 +1,3 @@
1
1
  module RakeFly
2
- VERSION = '2.2.0.pre.7'
2
+ VERSION = '2.6.0.pre.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake_fly
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0.pre.7
4
+ version: 2.6.0.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toby Clemson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-05 00:00:00.000000000 Z
11
+ date: 2021-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake_dependencies
@@ -56,14 +56,14 @@ dependencies:
56
56
  requirements:
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: '0.31'
59
+ version: '0.35'
60
60
  type: :runtime
61
61
  prerelease: false
62
62
  version_requirements: !ruby/object:Gem::Requirement
63
63
  requirements:
64
64
  - - ">="
65
65
  - !ruby/object:Gem::Version
66
- version: '0.31'
66
+ version: '0.35'
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: concourse.rb
69
69
  requirement: !ruby/object:Gem::Requirement
@@ -309,9 +309,11 @@ 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
316
+ - lib/rake_fly/tasks/pipeline/destroy.rb
315
317
  - lib/rake_fly/tasks/pipeline/get.rb
316
318
  - lib/rake_fly/tasks/pipeline/push.rb
317
319
  - lib/rake_fly/tasks/pipeline/set.rb