canzea 0.1.20 → 0.1.21
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/lib/canzea/version.rb +1 -1
- data/lib/canzea.rb +5 -4
- data/lib/commands/remote-bootstrap.rb +32 -0
- data/lib/commands/remote-run.rb +1 -2
- data/lib/ssh-base-cmd-class.rb +0 -23
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1a1fdb09688cd29d36e2d09d651c9fb89f13b1d
|
4
|
+
data.tar.gz: e220380fd5ee48d0ccbca5963eb4a1b472c6bb86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bf88fd9f812ce956b184038a66236e7c8a21bac03b2361a049cc5c9e3417dfd4069747152dc1c07f3926bac9abeb535b86cd81b753b290608aeb44ec915a427
|
7
|
+
data.tar.gz: 5110822e50b9d75fac3f04c25008a6ac6a4f8753908df88d78b3b848b3b1275d36cded90fed8bbdb052e699f0e1f3157861839dff04deaf1a4414a4f5c189f88
|
data/lib/canzea/version.rb
CHANGED
data/lib/canzea.rb
CHANGED
@@ -12,6 +12,7 @@ require "template-runner"
|
|
12
12
|
require "commands/config-git-commit"
|
13
13
|
require "commands/get-catalog"
|
14
14
|
require "commands/remote-run"
|
15
|
+
require "commands/remote-bootstrap"
|
15
16
|
require "commands/gen-user"
|
16
17
|
|
17
18
|
module Canzea
|
@@ -126,13 +127,13 @@ module Canzea
|
|
126
127
|
end
|
127
128
|
|
128
129
|
if opts[:init]
|
129
|
-
|
130
|
-
|
131
|
-
remote.init publicIp, opts[:privateKey]
|
130
|
+
publicIp = File.read("#{Canzea::config[:pwd]}/vps-#{opts[:serverBase]}-#{opts[:serverNumber]}.json")
|
131
|
+
RemoteInit.new.do publicIp, opts[:privateKey]
|
132
132
|
end
|
133
133
|
|
134
134
|
if opts[:remote]
|
135
|
-
|
135
|
+
publicIp = File.read("#{Canzea::config[:pwd]}/vps-#{opts[:serverBase]}-#{opts[:serverNumber]}.json")
|
136
|
+
RemoteRun.new.do publicIp, opts[:privateKey], opts[:role], opts[:solution]
|
136
137
|
end
|
137
138
|
|
138
139
|
if opts[:config_git_commit]
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require "git"
|
2
|
+
require "fileutils"
|
3
|
+
require "pathname"
|
4
|
+
require "ssh-base-cmd-class"
|
5
|
+
|
6
|
+
class RemoteInit
|
7
|
+
def init (publicIp, privateKey)
|
8
|
+
cmd1 = "yum -y install git"
|
9
|
+
|
10
|
+
cmd2 = "(rm -rf ike-environments && git clone https://gitlab.com/canzea/ecosystem-catalog.git)"
|
11
|
+
|
12
|
+
cmd3 = 'find /root/ike-environments -name "*.sh" -exec chmod +x {} +'
|
13
|
+
|
14
|
+
cmd4 = '(cd /root/ike-environments && ./roles/workarounds/ruby/install.sh)'
|
15
|
+
cmd5 = '(cd /root/ike-environments && ./roles/workarounds/ruby-gems/install.sh)'
|
16
|
+
cmd6 = '(cd /root/ike-environments && ./roles/workarounds/sshd/configure.sh)'
|
17
|
+
cmd7 = '(cd /root/ike-environments && ./roles/workarounds/sshd/enable.sh)'
|
18
|
+
cmd8 = '(cd /root/ike-environments && ./roles/workarounds/canzea/install-root.sh)'
|
19
|
+
|
20
|
+
remote = RemoteCall.new
|
21
|
+
|
22
|
+
remote.exec publicIp, privateKey, cmd1
|
23
|
+
remote.exec publicIp, privateKey, cmd2
|
24
|
+
remote.exec publicIp, privateKey, cmd3
|
25
|
+
remote.exec publicIp, privateKey, cmd4
|
26
|
+
remote.exec publicIp, privateKey, cmd5
|
27
|
+
remote.exec publicIp, privateKey, cmd6
|
28
|
+
remote.exec publicIp, privateKey, cmd7
|
29
|
+
remote.exec publicIp, privateKey, cmd8
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
data/lib/commands/remote-run.rb
CHANGED
@@ -4,8 +4,7 @@ require "pathname"
|
|
4
4
|
require "ssh-base-cmd-class"
|
5
5
|
|
6
6
|
class RemoteRun
|
7
|
-
def do(
|
8
|
-
publicIp = File.read("#{Canzea::config[:pwd]}/vps-#{serverBase}-#{serverNumber}.json")
|
7
|
+
def do(publicIp, privateKey, role, solution)
|
9
8
|
remote = RemoteCall.new
|
10
9
|
remote.exec publicIp, privateKey, "canzea --lifecycle=install --role=#{role} --solution=#{solution}"
|
11
10
|
end
|
data/lib/ssh-base-cmd-class.rb
CHANGED
@@ -5,29 +5,6 @@ require 'net/sftp'
|
|
5
5
|
require 'json'
|
6
6
|
|
7
7
|
class RemoteCall
|
8
|
-
def init (hostname, privateKey)
|
9
|
-
cmd1 = "yum -y install git"
|
10
|
-
|
11
|
-
cmd2 = "(rm -rf ike-environments && git clone https://IKE_CI:55665566@gitlab.com/ikethecoder/ike-environments.git)"
|
12
|
-
|
13
|
-
cmd3 = 'find /root/ike-environments -name "*.sh" -exec chmod +x {} +'
|
14
|
-
|
15
|
-
cmd4 = '(cd /root/ike-environments/environment/production && ./roles/workarounds/ruby/install.sh)'
|
16
|
-
cmd5 = '(cd /root/ike-environments/environment/production && ./roles/workarounds/ruby-gems/install.sh)'
|
17
|
-
cmd6 = '(cd /root/ike-environments/environment/production && ./roles/workarounds/sshd/configure.sh)'
|
18
|
-
cmd7 = '(cd /root/ike-environments/environment/production && ./roles/workarounds/sshd/enable.sh)'
|
19
|
-
cmd8 = '(cd /root/ike-environments/environment/production && ./roles/workarounds/canzea/install-root.sh)'
|
20
|
-
|
21
|
-
exec hostname, privateKey, cmd1
|
22
|
-
exec hostname, privateKey, cmd2
|
23
|
-
exec hostname, privateKey, cmd3
|
24
|
-
exec hostname, privateKey, cmd4
|
25
|
-
exec hostname, privateKey, cmd5
|
26
|
-
exec hostname, privateKey, cmd6
|
27
|
-
exec hostname, privateKey, cmd7
|
28
|
-
exec hostname, privateKey, cmd8
|
29
|
-
end
|
30
|
-
|
31
8
|
def exec (hostname, privateKey, cmd)
|
32
9
|
|
33
10
|
@username = "root"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: canzea
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Canzea Technologies
|
@@ -168,6 +168,7 @@ files:
|
|
168
168
|
- lib/commands/config-git-commit.rb
|
169
169
|
- lib/commands/gen-user.rb
|
170
170
|
- lib/commands/get-catalog.rb
|
171
|
+
- lib/commands/remote-bootstrap.rb
|
171
172
|
- lib/commands/remote-run.rb
|
172
173
|
- lib/helper-run-class.rb
|
173
174
|
- lib/plan-step-class.rb
|