rake_fly 2.10.0.pre.1 → 2.10.0.pre.4
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/Gemfile +2 -0
- data/Gemfile.lock +39 -10
- data/Rakefile +67 -45
- data/bin/console +4 -3
- data/lib/rake_fly/kernel_extensions.rb +2 -0
- data/lib/rake_fly/task_sets/authentication.rb +13 -8
- data/lib/rake_fly/task_sets/pipeline.rb +20 -16
- data/lib/rake_fly/task_sets/project.rb +79 -69
- data/lib/rake_fly/task_sets.rb +2 -0
- data/lib/rake_fly/tasks/authentication/ensure.rb +23 -15
- data/lib/rake_fly/tasks/authentication/login.rb +40 -20
- data/lib/rake_fly/tasks/pipeline/destroy.rb +28 -21
- data/lib/rake_fly/tasks/pipeline/get.rb +26 -19
- data/lib/rake_fly/tasks/pipeline/push.rb +12 -10
- data/lib/rake_fly/tasks/pipeline/set.rb +28 -21
- data/lib/rake_fly/tasks/pipeline/unpause.rb +23 -16
- data/lib/rake_fly/tasks.rb +2 -0
- data/lib/rake_fly/version.rb +3 -1
- data/lib/rake_fly.rb +103 -57
- data/rake_fly.gemspec +65 -0
- metadata +70 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecd38dbc5a32859dbc5c79ed756d0b0d0633616b12ee671955f96c1a6a00ec86
|
4
|
+
data.tar.gz: 4ee91baf475caffce6c7f365646195a462f1573b0fa683f73def43b4215c1a7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bb952f89dd0119f849ed684afb2b45a907d5d6b79fd39891a25477c925957fc78b133ff7a5e71a362fd0ac9ef17c7e683896b27c1b9e79c49f79d9402d42ffb
|
7
|
+
data.tar.gz: cc8098eb1ab1f5e132e32ea882924b1bcea34fac0e121fccba65a6f38264e1610fadfd56fc7275fe175b9310ed7564c12259fbc39f3afc4ebea59c5c96c8d0c5
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rake_fly (2.10.0.pre.
|
4
|
+
rake_fly (2.10.0.pre.4)
|
5
5
|
concourse.rb (>= 0.4)
|
6
6
|
rake_dependencies (~> 3.1)
|
7
7
|
rake_factory (~> 0.29)
|
@@ -11,19 +11,20 @@ PATH
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
activesupport (7.0.
|
14
|
+
activesupport (7.0.3.1)
|
15
15
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
16
16
|
i18n (>= 1.6, < 2)
|
17
17
|
minitest (>= 5.1)
|
18
18
|
tzinfo (~> 2.0)
|
19
19
|
addressable (2.8.0)
|
20
20
|
public_suffix (>= 2.0.2, < 5.0)
|
21
|
+
ast (2.4.2)
|
21
22
|
colored2 (3.1.2)
|
22
23
|
concourse.rb (0.4.0)
|
23
24
|
dry-schema (~> 0.5)
|
24
25
|
excon (~> 0.72)
|
25
26
|
semantic (~> 1.5)
|
26
|
-
concurrent-ruby (1.1.
|
27
|
+
concurrent-ruby (1.1.10)
|
27
28
|
diff-lcs (1.5.0)
|
28
29
|
docile (1.4.0)
|
29
30
|
dry-configurable (0.14.0)
|
@@ -55,8 +56,8 @@ GEM
|
|
55
56
|
dry-inflector (~> 0.1, >= 0.1.2)
|
56
57
|
dry-logic (~> 1.0, >= 1.0.2)
|
57
58
|
excon (0.92.0)
|
58
|
-
fakefs (1.
|
59
|
-
faker (2.
|
59
|
+
fakefs (1.8.0)
|
60
|
+
faker (2.23.0)
|
60
61
|
i18n (>= 1.8.11, < 2)
|
61
62
|
faraday (1.10.0)
|
62
63
|
faraday-em_http (~> 1.0)
|
@@ -84,21 +85,26 @@ GEM
|
|
84
85
|
gem-release (2.2.2)
|
85
86
|
hamster (3.0.0)
|
86
87
|
concurrent-ruby (~> 1.0)
|
87
|
-
i18n (1.
|
88
|
+
i18n (1.12.0)
|
88
89
|
concurrent-ruby (~> 1.0)
|
89
|
-
|
90
|
+
json (2.6.2)
|
91
|
+
jwt (2.5.0)
|
90
92
|
lino (3.0.0)
|
91
93
|
hamster (~> 3.0)
|
92
94
|
open4 (~> 1.3)
|
93
95
|
minitar (0.9)
|
94
|
-
minitest (5.
|
96
|
+
minitest (5.16.2)
|
95
97
|
multipart-post (2.1.1)
|
96
98
|
octokit (4.22.0)
|
97
99
|
faraday (>= 0.9)
|
98
100
|
sawyer (~> 0.8.0, >= 0.5.3)
|
99
101
|
open4 (1.3.4)
|
100
|
-
openssl (3.0.
|
102
|
+
openssl (3.0.1)
|
103
|
+
parallel (1.22.1)
|
104
|
+
parser (3.1.2.1)
|
105
|
+
ast (~> 2.4.1)
|
101
106
|
public_suffix (4.0.6)
|
107
|
+
rainbow (3.1.1)
|
102
108
|
rake (13.0.6)
|
103
109
|
rake_circle_ci (0.9.0)
|
104
110
|
colored2 (~> 3.1)
|
@@ -125,6 +131,8 @@ GEM
|
|
125
131
|
colored2 (~> 3.1)
|
126
132
|
rake_factory (~> 0.23)
|
127
133
|
sshkey (~> 2.0)
|
134
|
+
regexp_parser (2.5.0)
|
135
|
+
rexml (3.2.5)
|
128
136
|
rspec (3.11.0)
|
129
137
|
rspec-core (~> 3.11.0)
|
130
138
|
rspec-expectations (~> 3.11.0)
|
@@ -138,6 +146,23 @@ GEM
|
|
138
146
|
diff-lcs (>= 1.2.0, < 2.0)
|
139
147
|
rspec-support (~> 3.11.0)
|
140
148
|
rspec-support (3.11.0)
|
149
|
+
rubocop (1.36.0)
|
150
|
+
json (~> 2.3)
|
151
|
+
parallel (~> 1.10)
|
152
|
+
parser (>= 3.1.2.1)
|
153
|
+
rainbow (>= 2.2.2, < 4.0)
|
154
|
+
regexp_parser (>= 1.8, < 3.0)
|
155
|
+
rexml (>= 3.2.5, < 4.0)
|
156
|
+
rubocop-ast (>= 1.20.1, < 2.0)
|
157
|
+
ruby-progressbar (~> 1.7)
|
158
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
159
|
+
rubocop-ast (1.21.0)
|
160
|
+
parser (>= 3.1.1.0)
|
161
|
+
rubocop-rake (0.6.0)
|
162
|
+
rubocop (~> 1.0)
|
163
|
+
rubocop-rspec (2.12.1)
|
164
|
+
rubocop (~> 1.31)
|
165
|
+
ruby-progressbar (1.11.0)
|
141
166
|
ruby2_keywords (0.0.5)
|
142
167
|
ruby_fly (0.37.0)
|
143
168
|
lino (~> 3.0)
|
@@ -157,6 +182,7 @@ GEM
|
|
157
182
|
sshkey (2.0.0)
|
158
183
|
tzinfo (2.0.4)
|
159
184
|
concurrent-ruby (~> 1.0)
|
185
|
+
unicode-display_width (2.2.0)
|
160
186
|
|
161
187
|
PLATFORMS
|
162
188
|
ruby
|
@@ -177,7 +203,10 @@ DEPENDENCIES
|
|
177
203
|
rake_gpg
|
178
204
|
rake_ssh
|
179
205
|
rspec
|
206
|
+
rubocop
|
207
|
+
rubocop-rake
|
208
|
+
rubocop-rspec
|
180
209
|
simplecov
|
181
210
|
|
182
211
|
BUNDLED WITH
|
183
|
-
2.3.
|
212
|
+
2.3.22
|
data/Rakefile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'yaml'
|
2
4
|
require 'rake_circle_ci'
|
3
5
|
require 'rake_github'
|
@@ -5,17 +7,20 @@ require 'rake_ssh'
|
|
5
7
|
require 'rake_gpg'
|
6
8
|
require 'securerandom'
|
7
9
|
require 'rspec/core/rake_task'
|
10
|
+
require 'rubocop/rake_task'
|
8
11
|
|
9
|
-
task :
|
10
|
-
|
11
|
-
|
12
|
+
task default: %i[
|
13
|
+
library:fix
|
14
|
+
test:unit
|
15
|
+
]
|
12
16
|
|
13
17
|
namespace :encryption do
|
14
18
|
namespace :passphrase do
|
19
|
+
desc 'Generate encryption passphrase for CI GPG key'
|
15
20
|
task :generate do
|
16
|
-
|
17
|
-
|
18
|
-
|
21
|
+
FileUtils.mkdir_p('config/secrets/ci/')
|
22
|
+
File.write('config/secrets/ci/encryption.passphrase',
|
23
|
+
SecureRandom.base64(36))
|
19
24
|
end
|
20
25
|
end
|
21
26
|
end
|
@@ -23,85 +28,102 @@ end
|
|
23
28
|
namespace :keys do
|
24
29
|
namespace :deploy do
|
25
30
|
RakeSSH.define_key_tasks(
|
26
|
-
|
27
|
-
|
31
|
+
path: 'config/secrets/ci/',
|
32
|
+
comment: 'maintainers@infrablocks.io'
|
33
|
+
)
|
28
34
|
end
|
29
35
|
|
30
36
|
namespace :gpg do
|
31
37
|
RakeGPG.define_generate_key_task(
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
38
|
+
output_directory: 'config/secrets/ci',
|
39
|
+
name_prefix: 'gpg',
|
40
|
+
owner_name: 'InfraBlocks Maintainers',
|
41
|
+
owner_email: 'maintainers@infrablocks.io',
|
42
|
+
owner_comment: 'rake_fly CI Key'
|
43
|
+
)
|
37
44
|
end
|
38
45
|
end
|
39
46
|
|
47
|
+
RuboCop::RakeTask.new
|
48
|
+
|
49
|
+
namespace :library do
|
50
|
+
desc 'Run all checks of the library'
|
51
|
+
task check: [:rubocop]
|
52
|
+
|
53
|
+
desc 'Attempt to automatically fix issues with the library'
|
54
|
+
task fix: [:'rubocop:auto_correct']
|
55
|
+
end
|
56
|
+
|
57
|
+
namespace :test do
|
58
|
+
RSpec::Core::RakeTask.new(:unit)
|
59
|
+
end
|
60
|
+
|
40
61
|
RakeCircleCI.define_project_tasks(
|
41
|
-
|
42
|
-
|
62
|
+
namespace: :circle_ci,
|
63
|
+
project_slug: 'github/infrablocks/rake_fly'
|
43
64
|
) do |t|
|
44
65
|
circle_ci_config =
|
45
|
-
|
66
|
+
YAML.load_file('config/secrets/circle_ci/config.yaml')
|
46
67
|
|
47
|
-
t.api_token = circle_ci_config[
|
68
|
+
t.api_token = circle_ci_config['circle_ci_api_token']
|
48
69
|
t.environment_variables = {
|
49
|
-
|
50
|
-
|
51
|
-
|
70
|
+
ENCRYPTION_PASSPHRASE:
|
71
|
+
File.read('config/secrets/ci/encryption.passphrase')
|
72
|
+
.chomp
|
52
73
|
}
|
53
74
|
t.checkout_keys = []
|
54
75
|
t.ssh_keys = [
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
76
|
+
{
|
77
|
+
hostname: 'github.com',
|
78
|
+
private_key: File.read('config/secrets/ci/ssh.private')
|
79
|
+
}
|
59
80
|
]
|
60
81
|
end
|
61
82
|
|
62
83
|
RakeGithub.define_repository_tasks(
|
63
|
-
|
64
|
-
|
84
|
+
namespace: :github,
|
85
|
+
repository: 'infrablocks/rake_fly'
|
65
86
|
) do |t, args|
|
66
87
|
github_config =
|
67
|
-
|
88
|
+
YAML.load_file('config/secrets/github/config.yaml')
|
68
89
|
|
69
|
-
t.access_token = github_config[
|
90
|
+
t.access_token = github_config['github_personal_access_token']
|
70
91
|
t.deploy_keys = [
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
92
|
+
{
|
93
|
+
title: 'CircleCI',
|
94
|
+
public_key: File.read('config/secrets/ci/ssh.public')
|
95
|
+
}
|
75
96
|
]
|
76
97
|
t.branch_name = args.branch_name
|
77
98
|
t.commit_message = args.commit_message
|
78
99
|
end
|
79
100
|
|
80
101
|
namespace :pipeline do
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
102
|
+
desc 'Prepare CircleCI Pipeline'
|
103
|
+
task prepare: %i[
|
104
|
+
circle_ci:project:follow
|
105
|
+
circle_ci:env_vars:ensure
|
106
|
+
circle_ci:checkout_keys:ensure
|
107
|
+
circle_ci:ssh_keys:ensure
|
108
|
+
github:deploy_keys:ensure
|
87
109
|
]
|
88
110
|
end
|
89
111
|
|
90
112
|
namespace :version do
|
91
|
-
desc
|
113
|
+
desc 'Bump version for specified type (pre, major, minor, patch)'
|
92
114
|
task :bump, [:type] do |_, args|
|
93
115
|
bump_version_for(args.type)
|
94
116
|
end
|
95
117
|
end
|
96
118
|
|
97
|
-
desc
|
119
|
+
desc 'Release gem'
|
98
120
|
task :release do
|
99
|
-
sh
|
121
|
+
sh 'gem release --tag --push'
|
100
122
|
end
|
101
123
|
|
102
124
|
def bump_version_for(version_type)
|
103
|
-
sh "gem bump --version #{version_type} "
|
104
|
-
|
105
|
-
|
106
|
-
|
125
|
+
sh "gem bump --version #{version_type} " \
|
126
|
+
'&& bundle install ' \
|
127
|
+
'&& export LAST_MESSAGE="$(git log -1 --pretty=%B)" ' \
|
128
|
+
'&& git commit -a --amend -m "${LAST_MESSAGE} [ci skip]"'
|
107
129
|
end
|
data/bin/console
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
require
|
4
|
-
require
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'rake_fly'
|
5
6
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +11,5 @@ require "rake_fly"
|
|
10
11
|
# require "pry"
|
11
12
|
# Pry.start
|
12
13
|
|
13
|
-
require
|
14
|
+
require 'irb'
|
14
15
|
IRB.start(__FILE__)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rake_factory'
|
2
4
|
|
3
5
|
require_relative '../tasks/authentication/login'
|
@@ -14,12 +16,15 @@ module RakeFly
|
|
14
16
|
parameter :concourse_url, required: true
|
15
17
|
parameter :team, default: 'main'
|
16
18
|
|
17
|
-
parameter :backend,
|
19
|
+
parameter :backend,
|
20
|
+
default: RakeFly::Tasks::Authentication::Login::ApiBackend
|
18
21
|
parameter :username
|
19
22
|
parameter :password
|
20
23
|
|
21
24
|
parameter :home_directory,
|
22
|
-
|
25
|
+
default: RakeFactory::DynamicValue.new { |_|
|
26
|
+
Dir.home
|
27
|
+
}
|
23
28
|
|
24
29
|
parameter :login_task_name, default: :login
|
25
30
|
parameter :ensure_task_name, default: :ensure
|
@@ -27,13 +32,13 @@ module RakeFly
|
|
27
32
|
parameter :fly_ensure_task_name, default: :'fly:ensure'
|
28
33
|
|
29
34
|
task Tasks::Authentication::Login,
|
30
|
-
|
31
|
-
|
32
|
-
|
35
|
+
name: RakeFactory::DynamicValue.new { |ts|
|
36
|
+
ts.login_task_name
|
37
|
+
}
|
33
38
|
task Tasks::Authentication::Ensure,
|
34
|
-
|
35
|
-
|
36
|
-
|
39
|
+
name: RakeFactory::DynamicValue.new { |ts|
|
40
|
+
ts.ensure_task_name
|
41
|
+
}
|
37
42
|
end
|
38
43
|
end
|
39
44
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rake_factory'
|
2
4
|
|
3
5
|
require_relative '../tasks/pipeline/get'
|
@@ -22,7 +24,9 @@ module RakeFly
|
|
22
24
|
parameter :non_interactive
|
23
25
|
|
24
26
|
parameter :home_directory,
|
25
|
-
|
27
|
+
default: RakeFactory::DynamicValue.new { |_|
|
28
|
+
Dir.home
|
29
|
+
}
|
26
30
|
|
27
31
|
parameter :get_task_name, default: :get
|
28
32
|
parameter :set_task_name, default: :set
|
@@ -33,25 +37,25 @@ module RakeFly
|
|
33
37
|
parameter :fly_ensure_task_name, default: :'fly:ensure'
|
34
38
|
|
35
39
|
task Tasks::Pipeline::Get,
|
36
|
-
|
37
|
-
|
38
|
-
|
40
|
+
name: RakeFactory::DynamicValue.new { |ts|
|
41
|
+
ts.get_task_name
|
42
|
+
}
|
39
43
|
task Tasks::Pipeline::Set,
|
40
|
-
|
41
|
-
|
42
|
-
|
44
|
+
name: RakeFactory::DynamicValue.new { |ts|
|
45
|
+
ts.set_task_name
|
46
|
+
}
|
43
47
|
task Tasks::Pipeline::Unpause,
|
44
|
-
|
45
|
-
|
46
|
-
|
48
|
+
name: RakeFactory::DynamicValue.new { |ts|
|
49
|
+
ts.unpause_task_name
|
50
|
+
}
|
47
51
|
task Tasks::Pipeline::Push,
|
48
|
-
|
49
|
-
|
50
|
-
|
52
|
+
name: RakeFactory::DynamicValue.new { |ts|
|
53
|
+
ts.push_task_name
|
54
|
+
}
|
51
55
|
task Tasks::Pipeline::Destroy,
|
52
|
-
|
53
|
-
|
54
|
-
|
56
|
+
name: RakeFactory::DynamicValue.new { |ts|
|
57
|
+
ts.destroy_task_name
|
58
|
+
}
|
55
59
|
end
|
56
60
|
end
|
57
61
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rake_factory'
|
2
4
|
|
3
5
|
require_relative '../tasks/authentication/login'
|
@@ -9,6 +11,7 @@ require_relative '../tasks/pipeline/push'
|
|
9
11
|
|
10
12
|
module RakeFly
|
11
13
|
module TaskSets
|
14
|
+
# rubocop:disable Metrics/ClassLength
|
12
15
|
class Project < RakeFactory::TaskSet
|
13
16
|
prepend RakeFactory::Namespaceable
|
14
17
|
|
@@ -17,7 +20,8 @@ module RakeFly
|
|
17
20
|
parameter :concourse_url, required: true
|
18
21
|
parameter :team, default: 'main'
|
19
22
|
|
20
|
-
parameter :backend,
|
23
|
+
parameter :backend,
|
24
|
+
default: RakeFly::Tasks::Authentication::Login::ApiBackend
|
21
25
|
parameter :username
|
22
26
|
parameter :password
|
23
27
|
|
@@ -29,10 +33,12 @@ module RakeFly
|
|
29
33
|
parameter :non_interactive
|
30
34
|
|
31
35
|
parameter :target,
|
32
|
-
|
36
|
+
default: RakeFactory::DynamicValue.new { |t| t.team }
|
33
37
|
|
34
38
|
parameter :home_directory,
|
35
|
-
|
39
|
+
default: RakeFactory::DynamicValue.new { |_|
|
40
|
+
Dir.home
|
41
|
+
}
|
36
42
|
|
37
43
|
parameter :authentication_namespace, default: :authentication
|
38
44
|
parameter :authentication_login_task_name, default: :login
|
@@ -48,89 +54,93 @@ module RakeFly
|
|
48
54
|
parameter :fly_ensure_task_name, default: :'fly:ensure'
|
49
55
|
|
50
56
|
task Tasks::Authentication::Login,
|
51
|
-
|
52
|
-
|
53
|
-
|
57
|
+
name: RakeFactory::DynamicValue.new { |ts|
|
58
|
+
ts.authentication_login_task_name
|
59
|
+
}
|
54
60
|
task Tasks::Authentication::Ensure,
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
+
name: RakeFactory::DynamicValue.new { |ts|
|
62
|
+
ts.authentication_ensure_task_name
|
63
|
+
},
|
64
|
+
login_task_name: RakeFactory::DynamicValue.new { |ts|
|
65
|
+
ts.authentication_login_task_name
|
66
|
+
}
|
61
67
|
|
62
68
|
task Tasks::Pipeline::Get,
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
69
|
+
name: RakeFactory::DynamicValue.new { |ts|
|
70
|
+
ts.pipeline_get_task_name
|
71
|
+
},
|
72
|
+
authentication_ensure_task_name: RakeFactory::DynamicValue.new { |ts|
|
73
|
+
"#{ts.authentication_namespace}:" \
|
74
|
+
"#{ts.authentication_ensure_task_name}"
|
75
|
+
.to_sym
|
76
|
+
}
|
71
77
|
task Tasks::Pipeline::Set,
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
78
|
+
name: RakeFactory::DynamicValue.new { |ts|
|
79
|
+
ts.pipeline_set_task_name
|
80
|
+
},
|
81
|
+
authentication_ensure_task_name: RakeFactory::DynamicValue.new { |ts|
|
82
|
+
"#{ts.authentication_namespace}:" \
|
83
|
+
"#{ts.authentication_ensure_task_name}"
|
84
|
+
.to_sym
|
85
|
+
}
|
80
86
|
task Tasks::Pipeline::Unpause,
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
87
|
+
name: RakeFactory::DynamicValue.new { |ts|
|
88
|
+
ts.pipeline_unpause_task_name
|
89
|
+
},
|
90
|
+
authentication_ensure_task_name: RakeFactory::DynamicValue.new { |ts|
|
91
|
+
"#{ts.authentication_namespace}:" \
|
92
|
+
"#{ts.authentication_ensure_task_name}"
|
93
|
+
.to_sym
|
94
|
+
}
|
89
95
|
task Tasks::Pipeline::Push,
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
96
|
+
name: RakeFactory::DynamicValue.new { |ts|
|
97
|
+
ts.pipeline_push_task_name
|
98
|
+
},
|
99
|
+
get_task_name: RakeFactory::DynamicValue.new { |ts|
|
100
|
+
ts.pipeline_get_task_name
|
101
|
+
},
|
102
|
+
set_task_name: RakeFactory::DynamicValue.new { |ts|
|
103
|
+
ts.pipeline_set_task_name
|
104
|
+
},
|
105
|
+
unpause_task_name: RakeFactory::DynamicValue.new { |ts|
|
106
|
+
ts.pipeline_unpause_task_name
|
107
|
+
}
|
102
108
|
task Tasks::Pipeline::Destroy,
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
109
|
+
name: RakeFactory::DynamicValue.new { |ts|
|
110
|
+
ts.pipeline_destroy_task_name
|
111
|
+
},
|
112
|
+
authentication_ensure_task_name: RakeFactory::DynamicValue.new { |ts|
|
113
|
+
"#{ts.authentication_namespace}:" \
|
114
|
+
"#{ts.authentication_ensure_task_name}"
|
115
|
+
.to_sym
|
116
|
+
}
|
111
117
|
|
112
118
|
def define_on(application)
|
113
119
|
around_define(application) do
|
114
120
|
self.class.tasks.each do |task_definition|
|
115
|
-
|
116
|
-
ns = case task_class
|
117
|
-
when /Pipeline/
|
118
|
-
pipeline_namespace
|
119
|
-
when /Authentication/
|
120
|
-
authentication_namespace
|
121
|
-
else
|
122
|
-
raise StandardError.new(
|
123
|
-
"Unexpected task definition: #{task_class}.")
|
124
|
-
end
|
121
|
+
namespace = resolve_namespace(task_definition)
|
125
122
|
|
126
|
-
application.in_namespace(
|
123
|
+
application.in_namespace(namespace) do
|
127
124
|
task_definition
|
128
|
-
|
129
|
-
|
125
|
+
.for_task_set(self)
|
126
|
+
.define_on(application)
|
130
127
|
end
|
131
128
|
end
|
132
129
|
end
|
133
130
|
end
|
131
|
+
|
132
|
+
private
|
133
|
+
|
134
|
+
def resolve_namespace(task_definition)
|
135
|
+
case task_definition.klass.to_s
|
136
|
+
when /Pipeline/ then pipeline_namespace
|
137
|
+
when /Authentication/ then authentication_namespace
|
138
|
+
else
|
139
|
+
raise StandardError,
|
140
|
+
"Unexpected task definition: #{task_definition.klass}."
|
141
|
+
end
|
142
|
+
end
|
134
143
|
end
|
144
|
+
# rubocop:enable Metrics/ClassLength
|
135
145
|
end
|
136
146
|
end
|