cloudstrap-azure 0.4.13.pre → 0.5.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/command/cloudstrap-azure +126 -5
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 066f8b2d9a48ffff68c8ff9b2ad849020cb69d43c75b9ed0b08a35d9f976c305
|
4
|
+
data.tar.gz: e7787cf84a74a2e27e9c69158bcb72a543ff33254d1fd81aebf58cc4eb5b366d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7d0015456d7096c04a330292a5a9258994ae90df2709f29e81ee331c85f146e70fbb8457613f04c2ceb8080a10889d0be494a80d2ca8106fe172fc89d2db124
|
7
|
+
data.tar.gz: 2417e01b9edb67eaf0fc5abfec56fe1941620b6d9abfb878db24e5c3a56054a1528d754254dbd71f4c313a5af812278d4a7dab74ad57b2b7bd88e70ed88fb9ac
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/command/cloudstrap-azure
CHANGED
@@ -1,13 +1,134 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
2
|
# -*- ruby -*-
|
3
3
|
|
4
|
+
require 'optparse' # Ruby Standard Library
|
5
|
+
|
6
|
+
require 'pastel' # MIT License
|
7
|
+
|
8
|
+
#############
|
9
|
+
# Constants #
|
10
|
+
#############
|
11
|
+
|
12
|
+
INTERNAL_COMMAND_PATH = File.expand_path(File.join(__dir__, 'internal'))
|
13
|
+
LICENSE_FILE = File.expand_path(File.join(__dir__, '..', 'LICENSE.txt'))
|
14
|
+
PROGRAM = File.basename($PROGRAM_NAME)
|
15
|
+
SPDX_LICENSE_IDENTIFIER = 'MIT'
|
16
|
+
|
17
|
+
####################
|
18
|
+
# Helper Functions #
|
19
|
+
####################
|
20
|
+
|
21
|
+
Bold = ->(string) { Pastel.new.bold(string) }
|
22
|
+
Red = ->(string) { Pastel.new.red(string) }
|
23
|
+
ExitAfterPrinting = ->(message) { puts(message); exit }
|
24
|
+
|
25
|
+
def commands
|
26
|
+
if RUBY_VERSION >= '2.5.0'
|
27
|
+
Dir.children(INTERNAL_COMMAND_PATH)
|
28
|
+
else
|
29
|
+
Dir.entries(INTERNAL_COMMAND_PATH).reject do |entry|
|
30
|
+
%w(. ..).include? entry
|
31
|
+
end
|
32
|
+
end.map do |command|
|
33
|
+
command.gsub Regexp.new("^#{PROGRAM}."), ''
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
###################
|
38
|
+
# Option Handling #
|
39
|
+
###################
|
40
|
+
|
41
|
+
options = {}
|
42
|
+
|
43
|
+
OptionParser.new do |opts|
|
44
|
+
opts.banner = "#{PROGRAM} [options] <command>"
|
45
|
+
opts.on('--available-commands') { ExitAfterPrinting.(commands) }
|
46
|
+
opts.on('--guide') do
|
47
|
+
ExitAfterPrinting.("
|
48
|
+
Welcome to #{Bold.(PROGRAM)}!
|
49
|
+
|
50
|
+
This program automates Azure Container Service deployments.
|
51
|
+
|
52
|
+
The first thing you should do is log in to Azure (this only needs to be done
|
53
|
+
once under normal operating conditions):
|
54
|
+
|
55
|
+
#{Bold.('az login')}
|
56
|
+
|
57
|
+
Once you have successfully logged in, you can use the #{Bold.('environment')}
|
58
|
+
command to get a fresh set of tokens at any time. Given no arguments, this will
|
59
|
+
print some JSON to STDOUT that includes access tokens. This is intended for use
|
60
|
+
in scripts.
|
61
|
+
|
62
|
+
#{Bold.(PROGRAM + ' environment')}
|
63
|
+
|
64
|
+
If you provide additional arguments to the #{Bold.('environment')} command, the
|
65
|
+
access tokens will be added to the environment, and the program
|
66
|
+
will #{Bold.('exec')} into the remaining arguments. This is intended for
|
67
|
+
programs that read from environment.
|
68
|
+
|
69
|
+
#{Bold.(PROGRAM + ' environment -- env')}
|
70
|
+
|
71
|
+
The rest of #{Bold.(PROGRAM)} assumes that access tokens will be available in
|
72
|
+
the environment.
|
73
|
+
|
74
|
+
The next step is to configure #{Bold.(PROGRAM)}! The #{Bold.('configure')}
|
75
|
+
command provides a simple way to do this interactively. This is generally a
|
76
|
+
one-time process, but you can safely run it multiple times. It will read the
|
77
|
+
current configuration and only change the things you tell it to.
|
78
|
+
|
79
|
+
#{Bold.(PROGRAM + ' environment -- ' + PROGRAM + ' configure')}
|
80
|
+
|
81
|
+
Once the program is configured, it's time to deploy things!
|
82
|
+
The #{Bold.('deploy')} command takes care of this. Like #{Bold.('configure')},
|
83
|
+
it is safe to run multiple times.
|
84
|
+
|
85
|
+
#{Bold.(PROGRAM + ' environment -- ' + PROGRAM + ' deploy')}
|
86
|
+
|
87
|
+
That's it! If you've made it this far, you should have a working ACS deployment.
|
88
|
+
|
89
|
+
Thanks for using #{Bold.(PROGRAM)}!
|
90
|
+
|
91
|
+
")
|
92
|
+
end
|
93
|
+
|
94
|
+
opts.on('--workaround-linux-shebang-limitations') do
|
95
|
+
# https://lists.gnu.org/archive/html/bug-sh-utils/2002-04/msg00020.html
|
96
|
+
options[:workaround_linux_shebang_limitations] = true
|
97
|
+
end
|
98
|
+
opts.on('--spdx-license-identifier') { ExitAfterPrinting.(SPDX_LICENSE_IDENTIFIER) }
|
99
|
+
opts.on('--full-license-text') { ExitAfterPrinting.(File.read(LICENSE_FILE) + "\n") }
|
100
|
+
end.parse!
|
101
|
+
|
102
|
+
#################
|
103
|
+
# Sanity Checks #
|
104
|
+
#################
|
105
|
+
|
106
|
+
exit Errno::EINVAL::Errno if ARGV.empty?
|
107
|
+
|
108
|
+
options[:workaround_linux_shebang_limitations] ||= (RbConfig::CONFIG['arch'] =~ /linux/) ? true : false
|
109
|
+
|
110
|
+
################
|
111
|
+
# Main Program #
|
112
|
+
################
|
113
|
+
|
114
|
+
COMMAND = ARGV.shift
|
115
|
+
|
4
116
|
PATH = ENV['PATH'] = [
|
5
|
-
|
117
|
+
INTERNAL_COMMAND_PATH,
|
6
118
|
ENV['PATH']
|
7
119
|
].join(':')
|
8
120
|
|
9
|
-
|
10
|
-
|
11
|
-
|
121
|
+
begin
|
122
|
+
if options[:workaround_linux_shebang_limitations]
|
123
|
+
INTERNAL_COMMAND = File.join(INTERNAL_COMMAND_PATH, "#{PROGRAM}.#{COMMAND}")
|
124
|
+
raise Errno::ENOENT unless File.exist? INTERNAL_COMMAND
|
125
|
+
exec(RbConfig.ruby, '-W0', INTERNAL_COMMAND)
|
126
|
+
else
|
127
|
+
exec({ 'PATH' => PATH }, "#{PROGRAM}.#{COMMAND}", *ARGV)
|
128
|
+
end
|
12
129
|
|
13
|
-
|
130
|
+
rescue Errno::ENOENT
|
131
|
+
STDERR.puts Red.("#{Bold.(COMMAND)} does not seem to be a valid command. Try this:\n")
|
132
|
+
STDERR.puts Bold.("#{PROGRAM} --available-commands\n")
|
133
|
+
exit Errno::ENOENT::Errno
|
134
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudstrap-azure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Olstrom
|
@@ -34,7 +34,7 @@ cert_chain:
|
|
34
34
|
EIKh6yDoB+oCRuiTV0uw/lKE2PtbONhJb7uN1qhZqla/iBpmUjiEu8+skI+ygv9n
|
35
35
|
7Krw8FJrV3+VRCiZTPKHeshAfL9yeIZh
|
36
36
|
-----END CERTIFICATE-----
|
37
|
-
date: 2018-04-
|
37
|
+
date: 2018-04-20 00:00:00.000000000 Z
|
38
38
|
dependencies:
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: azure_graph_rbac
|
metadata.gz.sig
CHANGED
Binary file
|