avm-tools 0.24.0 → 0.25.0

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: 4deaa72e5e51d1dc4db756e57ea2bd1c8c6578f531d1ef2084a330719d74fb15
4
- data.tar.gz: 6dd2b7bf04bdaa95b24d020fa7f4947ed3197588e497fe40ce51c0a5f90a688c
3
+ metadata.gz: b281c9ce7a6b01c3627f2176525badcb1e8da74db083a19e4a044183a81d5098
4
+ data.tar.gz: bed6e84f9f7ffbc8cb04f801d946bb3d121aa037b091d3eb7674a003608766e0
5
5
  SHA512:
6
- metadata.gz: 85cbe7adec68930b3d499a5d9765a8d86072a32f2f41730455c7236d5ba940dcee7fe259718840146143972c90cd0b50799c059f3745801051322ad5e733b978
7
- data.tar.gz: 8dc0bb879ed769cc3760c4cbaf02dc2b62a7d765e97eb7bf7fcfc5cfaa15e761b1b95e57504e7ec79c7519dadd19077301a2ca679deddac41789feed60640fa0
6
+ metadata.gz: a2f4351b55f7e26efa4db5e92f3c8d0cc559380cc17f38fc41881c202c57c6caec07ab357934cdf4bc46419c7881bea01f0fd7ddf17db9948339ef14a34ea81d
7
+ data.tar.gz: 18357869454f75bd31b70e098a624beb3caa00a289ccc0bb15533aca7cb2ed3ac206503c26babc56660d9c09ec1471a42bab51d48114209df86a9102919f7613
@@ -12,6 +12,14 @@ module Avm
12
12
  def auto_data_fs_path
13
13
  inherited_entry_value(:host_id, :data_fs_path) { |v| v + '/' + id }
14
14
  end
15
+
16
+ def auto_fs_url
17
+ read_entry_optional('ssh.url').if_present do |ssh_url|
18
+ read_entry_optional('fs_path').if_present do |fs_path|
19
+ "#{ssh_url}#{fs_path}"
20
+ end
21
+ end
22
+ end
15
23
  end
16
24
  end
17
25
  end
@@ -17,14 +17,15 @@ module Avm
17
17
  DOC = <<~DOCOPT
18
18
  Deploy a Git revision to a location (Local or remote).
19
19
 
20
- Usage:
21
- __PROGRAM__ [options] <target-url> [<append-directories>...]
22
- __PROGRAM__ -h | --help
20
+ Usage:
21
+ __PROGRAM__ [options] [<target-url>]
22
+ __PROGRAM__ -h | --help
23
23
 
24
24
  Options:
25
25
  -h --help Mostra esta ajuda.
26
26
  -r --reference=<reference> Reference [default: HEAD].
27
27
  -i --instance=<instance-id> Read entries from instance with id=<instance-id>.
28
+ -a --append-dirs=<append-dirs> Append directories to deploy (List separated by ":").
28
29
  DOCOPT
29
30
 
30
31
  def run
@@ -41,12 +42,14 @@ module Avm
41
42
  infov 'Reference', reference
42
43
  infov 'Instance ID', instance_id.if_present('- BLANK -')
43
44
  infov 'Appended directories', appended_directories
45
+ infov 'Target URL', target_url
44
46
  end
45
47
 
46
48
  def validate
47
- return if reference_sha1.present?
48
-
49
- fatal_error "Object ID not found for reference \"#{reference}\""
49
+ unless reference_sha1.present?
50
+ fatal_error "Object ID not found for reference \"#{reference}\""
51
+ end
52
+ fatal_error 'Nor <target-url> nor --instance was setted' unless target_url.present?
50
53
  end
51
54
 
52
55
  def main_info_banner
@@ -67,12 +70,18 @@ module Avm
67
70
 
68
71
  def deploy
69
72
  ::Avm::Git::Commit.new(git, reference_sha1)
70
- .deploy_to_url(options.fetch('<target-url>'))
73
+ .deploy_to_url(target_url)
71
74
  .append_directories(appended_directories)
72
75
  .variables_source_set(variables_source)
73
76
  .run
74
77
  end
75
78
 
79
+ def target_url
80
+ options['<target-url>'].if_present { |v| return v }
81
+ instance.if_present { |v| return v.read_entry('fs.url') }
82
+ nil
83
+ end
84
+
76
85
  def variables_source
77
86
  instance || ::Avm.configs
78
87
  end
@@ -86,7 +95,7 @@ module Avm
86
95
  end
87
96
 
88
97
  def appended_directories
89
- options.fetch('<append-directories>')
98
+ options.fetch('--append-dirs').to_s.split(':')
90
99
  end
91
100
  end
92
101
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.24.0'
5
+ VERSION = '0.25.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.0
4
+ version: 0.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-04 00:00:00.000000000 Z
11
+ date: 2019-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers