rake_fly 2.2.0.pre.2 → 2.2.0.pre.7

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: 8193420614d6427a3febfdf052dab45453755393aa2f59123cb5f1d87d2330ab
4
- data.tar.gz: 91f83c140311ef789ddc273e28522e8b1ecfc9c7dcc39fb1c7a9b967b869c367
3
+ metadata.gz: afb1b3a4898cc6ec6a31aa66e6676c848c3db0a61f1339da535d16e4520323ae
4
+ data.tar.gz: 86186bf53bfd095a8fa3b9f9a5733f1de176429602a3ceaeacb5aa8cbac4d757
5
5
  SHA512:
6
- metadata.gz: 4e523ed35af7e983ec3d5c40bb621d925fef84a0328316d9430a87110d93d52bc566ea12cf8c3436d872cc38ba05492ffdf6e214fe3d0964f6923e3303eda3eb
7
- data.tar.gz: b1bb8d57e58151397cb3eea555c16baa3ed990b7a38b7b77abaaea38ddcd8c99effd3c11403f1341c14fce42720fa78fe2aea465d77e997ad7f7be6338cc2e19
6
+ metadata.gz: a6fb482d84fb6ca94580a009652e26df0c327b5a9fa43094f22eebd388028c85c804840b1ac0d5bf170b33d32ee85e641971852da7e5646ced381cac7c0c8338
7
+ data.tar.gz: 18dd7843beb8ecc31d1c570babbf09beb71b62d546b85cafec6299366f7ede5ad2f676f7e6af9138884af3108d0fb6cb11e07e14d48d7fd599cb35b03b1e5b52
@@ -1,11 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rake_fly (2.2.0.pre.2)
5
- concourse.rb (= 0.3.0.pre.2)
4
+ rake_fly (2.2.0.pre.7)
5
+ concourse.rb (>= 0.4)
6
6
  rake_dependencies (~> 2, < 3)
7
7
  rake_factory (>= 0.29, < 1)
8
- ruby_fly (>= 0.23)
8
+ ruby_fly (>= 0.31)
9
9
  semantic (~> 1.6.1)
10
10
 
11
11
  GEM
@@ -20,7 +20,7 @@ GEM
20
20
  addressable (2.7.0)
21
21
  public_suffix (>= 2.0.2, < 5.0)
22
22
  colored2 (3.1.2)
23
- concourse.rb (0.3.0.pre.2)
23
+ concourse.rb (0.4.0)
24
24
  dry-schema (~> 0.5)
25
25
  excon (~> 0.72)
26
26
  semantic (~> 1.5)
@@ -123,7 +123,7 @@ GEM
123
123
  rspec-support (~> 3.10.0)
124
124
  rspec-support (3.10.1)
125
125
  ruby2_keywords (0.0.2)
126
- ruby_fly (0.23.0)
126
+ ruby_fly (0.31.0)
127
127
  lino (>= 1.5)
128
128
  ruby_gpg2 (0.8.0)
129
129
  lino (>= 1.5)
@@ -132,7 +132,7 @@ GEM
132
132
  addressable (>= 2.3.5)
133
133
  faraday (> 0.8, < 2.0)
134
134
  semantic (1.6.1)
135
- simplecov (0.21.0)
135
+ simplecov (0.21.1)
136
136
  docile (~> 1.1)
137
137
  simplecov-html (~> 0.11)
138
138
  simplecov_json_formatter (~> 0.1)
@@ -1 +1,2 @@
1
1
  require_relative 'task_sets/pipeline'
2
+ require_relative 'task_sets/authentication'
@@ -0,0 +1,37 @@
1
+ require 'rake_factory'
2
+
3
+ require_relative '../tasks/authentication/login'
4
+ require_relative '../tasks/authentication/ensure'
5
+
6
+ module RakeFly
7
+ module TaskSets
8
+ class Authentication < RakeFactory::TaskSet
9
+ prepend RakeFactory::Namespaceable
10
+
11
+ parameter :argument_names, default: []
12
+
13
+ parameter :target, required: true
14
+ parameter :concourse_url, required: true
15
+ parameter :team, default: 'main'
16
+ parameter :username
17
+ parameter :password
18
+
19
+ parameter :home_directory,
20
+ default: RakeFactory::DynamicValue.new { |_| ENV['HOME'] }
21
+
22
+ parameter :login_task_name, default: :login
23
+ parameter :ensure_task_name, default: :ensure
24
+
25
+ parameter :fly_ensure_task_name, default: :'fly:ensure'
26
+
27
+ task Tasks::Authentication::Login,
28
+ name: RakeFactory::DynamicValue.new { |ts|
29
+ ts.login_task_name
30
+ }
31
+ task Tasks::Authentication::Ensure,
32
+ name: RakeFactory::DynamicValue.new { |ts|
33
+ ts.ensure_task_name
34
+ }
35
+ end
36
+ end
37
+ end
@@ -8,21 +8,28 @@ require_relative '../tasks/pipeline/push'
8
8
  module RakeFly
9
9
  module TaskSets
10
10
  class Pipeline < RakeFactory::TaskSet
11
+ prepend RakeFactory::Namespaceable
12
+
11
13
  parameter :argument_names, default: []
12
14
 
13
- parameter :target, :required => true
15
+ parameter :target, required: true
14
16
  parameter :team
15
- parameter :pipeline, :required => true
16
- parameter :config, :required => true
17
+ parameter :pipeline, required: true
18
+ parameter :config, required: true
17
19
 
18
20
  parameter :vars
19
21
  parameter :var_files
20
22
  parameter :non_interactive
21
23
 
22
- parameter :get_task_name, :default => :get
23
- parameter :set_task_name, :default => :set
24
- parameter :unpause_task_name, :default => :unpause
25
- parameter :push_task_name, :default => :push
24
+ parameter :home_directory,
25
+ default: RakeFactory::DynamicValue.new { |_| ENV['HOME'] }
26
+
27
+ parameter :get_task_name, default: :get
28
+ parameter :set_task_name, default: :set
29
+ parameter :unpause_task_name, default: :unpause
30
+ parameter :push_task_name, default: :push
31
+
32
+ parameter :fly_ensure_task_name, default: :'fly:ensure'
26
33
 
27
34
  task Tasks::Pipeline::Get,
28
35
  name: RakeFactory::DynamicValue.new { |ts|
@@ -1,4 +1,5 @@
1
1
  require_relative 'tasks/authentication/login'
2
+ require_relative 'tasks/authentication/ensure'
2
3
  require_relative 'tasks/pipeline/get'
3
4
  require_relative 'tasks/pipeline/set'
4
5
  require_relative 'tasks/pipeline/unpause'
@@ -0,0 +1,43 @@
1
+ require 'ruby_fly'
2
+ require 'rake_factory'
3
+ require 'concourse'
4
+
5
+ module RakeFly
6
+ module Tasks
7
+ module Authentication
8
+ class Ensure < RakeFactory::Task
9
+ default_name :ensure
10
+ default_prerequisites RakeFactory::DynamicValue.new { |t|
11
+ [t.fly_ensure_task_name]
12
+ }
13
+ default_description RakeFactory::DynamicValue.new { |t|
14
+ target = t.target || '<derived>'
15
+
16
+ "Ensure logged in for target #{target}"
17
+ }
18
+
19
+ parameter :target, required: true
20
+
21
+ parameter :home_directory,
22
+ default: RakeFactory::DynamicValue.new { |_| ENV['HOME'] }
23
+
24
+ parameter :fly_ensure_task_name, :default => :'fly:ensure'
25
+
26
+ action do |t, args|
27
+ puts "Ensuring target #{t.target} is logged in..."
28
+ status = RubyFly.status(
29
+ target: t.target,
30
+ environment: {
31
+ "HOME" => t.home_directory
32
+ })
33
+ if status == :logged_in
34
+ puts "Already logged in. Continuing..."
35
+ else
36
+ puts "Not logged in. Logging in..."
37
+ t.application[:login, t.scope].invoke(*args)
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -8,11 +8,19 @@ module RakeFly
8
8
  class Login < RakeFactory::Task
9
9
  class FlyBackend
10
10
  def resolve_prerequisites(task)
11
- [task.ensure_task_name]
11
+ [task.fly_ensure_task_name]
12
12
  end
13
13
 
14
- def execute(_)
15
-
14
+ def execute(task)
15
+ RubyFly.login(
16
+ target: task.target,
17
+ concourse_url: task.concourse_url,
18
+ username: task.username,
19
+ password: task.password,
20
+ team: task.team,
21
+ environment: {
22
+ "HOME" => task.home_directory
23
+ })
16
24
  end
17
25
  end
18
26
 
@@ -60,7 +68,7 @@ module RakeFly
60
68
  parameter :home_directory,
61
69
  default: RakeFactory::DynamicValue.new { |_| ENV['HOME'] }
62
70
 
63
- parameter :ensure_task_name, :default => :'fly:ensure'
71
+ parameter :fly_ensure_task_name, :default => :'fly:ensure'
64
72
 
65
73
  action do |t|
66
74
  puts "Logging in to #{t.concourse_url} as target #{t.target}..."
@@ -7,7 +7,7 @@ module RakeFly
7
7
  class Get < RakeFactory::Task
8
8
  default_name :get
9
9
  default_prerequisites RakeFactory::DynamicValue.new { |t|
10
- [t.ensure_task_name]
10
+ [t.fly_ensure_task_name, t.authentication_ensure_task_name]
11
11
  }
12
12
  default_description RakeFactory::DynamicValue.new { |t|
13
13
  pipeline = t.pipeline || '<derived>'
@@ -18,14 +18,22 @@ module RakeFly
18
18
 
19
19
  parameter :target, :required => true
20
20
  parameter :pipeline, :required => true
21
-
22
- parameter :ensure_task_name, :default => :'fly:ensure'
21
+
22
+ parameter :home_directory,
23
+ default: RakeFactory::DynamicValue.new { |_| ENV['HOME'] }
24
+
25
+ parameter :fly_ensure_task_name, :default => :'fly:ensure'
26
+ parameter :authentication_ensure_task_name,
27
+ :default => :'authentication:ensure'
23
28
 
24
29
  action do |t|
25
30
  puts "Getting pipeline #{t.pipeline} for target #{t.target}..."
26
31
  RubyFly.get_pipeline(
27
32
  target: t.target,
28
- pipeline: t.pipeline)
33
+ pipeline: t.pipeline,
34
+ environment: {
35
+ "HOME" => t.home_directory
36
+ })
29
37
  end
30
38
  end
31
39
  end
@@ -7,7 +7,7 @@ module RakeFly
7
7
  class Set < RakeFactory::Task
8
8
  default_name :set
9
9
  default_prerequisites RakeFactory::DynamicValue.new { |t|
10
- [t.ensure_task_name]
10
+ [t.fly_ensure_task_name, t.authentication_ensure_task_name]
11
11
  }
12
12
  default_description RakeFactory::DynamicValue.new { |t|
13
13
  pipeline = t.pipeline || '<derived>'
@@ -25,7 +25,12 @@ module RakeFly
25
25
  parameter :var_files
26
26
  parameter :non_interactive
27
27
 
28
- parameter :ensure_task_name, :default => :'fly:ensure'
28
+ parameter :home_directory,
29
+ default: RakeFactory::DynamicValue.new { |_| ENV['HOME'] }
30
+
31
+ parameter :fly_ensure_task_name, :default => :'fly:ensure'
32
+ parameter :authentication_ensure_task_name,
33
+ :default => :'authentication:ensure'
29
34
 
30
35
  action do |t|
31
36
  puts "Setting pipeline #{t.pipeline} for target #{t.target}..."
@@ -36,7 +41,10 @@ module RakeFly
36
41
  config: t.config,
37
42
  vars: t.vars,
38
43
  var_files: t.var_files,
39
- non_interactive: t.non_interactive)
44
+ non_interactive: t.non_interactive,
45
+ environment: {
46
+ "HOME" => t.home_directory
47
+ })
40
48
  end
41
49
  end
42
50
  end
@@ -7,7 +7,7 @@ module RakeFly
7
7
  class Unpause < RakeFactory::Task
8
8
  default_name :unpause
9
9
  default_prerequisites RakeFactory::DynamicValue.new { |t|
10
- [t.ensure_task_name]
10
+ [t.fly_ensure_task_name, t.authentication_ensure_task_name]
11
11
  }
12
12
  default_description RakeFactory::DynamicValue.new { |t|
13
13
  pipeline = t.pipeline || '<derived>'
@@ -20,14 +20,22 @@ module RakeFly
20
20
  parameter :team
21
21
  parameter :pipeline, :required => true
22
22
 
23
- parameter :ensure_task_name, :default => :'fly:ensure'
23
+ parameter :home_directory,
24
+ default: RakeFactory::DynamicValue.new { |_| ENV['HOME'] }
25
+
26
+ parameter :fly_ensure_task_name, :default => :'fly:ensure'
27
+ parameter :authentication_ensure_task_name,
28
+ :default => :'authentication:ensure'
24
29
 
25
30
  action do |t|
26
31
  puts "Unpausing pipeline #{t.pipeline} for target #{t.target}..."
27
32
  RubyFly.unpause_pipeline(
28
33
  target: t.target,
29
34
  team: t.team,
30
- pipeline: t.pipeline)
35
+ pipeline: t.pipeline,
36
+ environment: {
37
+ "HOME" => t.home_directory
38
+ })
31
39
  end
32
40
  end
33
41
  end
@@ -1,3 +1,3 @@
1
1
  module RakeFly
2
- VERSION = '2.2.0.pre.2'
2
+ VERSION = '2.2.0.pre.7'
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.2
4
+ version: 2.2.0.pre.7
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-04 00:00:00.000000000 Z
11
+ date: 2021-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake_dependencies
@@ -56,28 +56,28 @@ dependencies:
56
56
  requirements:
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: '0.23'
59
+ version: '0.31'
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.23'
66
+ version: '0.31'
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: concourse.rb
69
69
  requirement: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - '='
71
+ - - ">="
72
72
  - !ruby/object:Gem::Version
73
- version: 0.3.0.pre.2
73
+ version: '0.4'
74
74
  type: :runtime
75
75
  prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - '='
78
+ - - ">="
79
79
  - !ruby/object:Gem::Version
80
- version: 0.3.0.pre.2
80
+ version: '0.4'
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: semantic
83
83
  requirement: !ruby/object:Gem::Requirement
@@ -307,8 +307,10 @@ files:
307
307
  - lib/rake_fly.rb
308
308
  - lib/rake_fly/kernel_extensions.rb
309
309
  - lib/rake_fly/task_sets.rb
310
+ - lib/rake_fly/task_sets/authentication.rb
310
311
  - lib/rake_fly/task_sets/pipeline.rb
311
312
  - lib/rake_fly/tasks.rb
313
+ - lib/rake_fly/tasks/authentication/ensure.rb
312
314
  - lib/rake_fly/tasks/authentication/login.rb
313
315
  - lib/rake_fly/tasks/pipeline/get.rb
314
316
  - lib/rake_fly/tasks/pipeline/push.rb