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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b1b253d8bcadef43d741fa94d02ab7f6459e55b
4
- data.tar.gz: 8cdbda655710f756b42f07e6aa4fd67b37416bb8
3
+ metadata.gz: d1a1fdb09688cd29d36e2d09d651c9fb89f13b1d
4
+ data.tar.gz: e220380fd5ee48d0ccbca5963eb4a1b472c6bb86
5
5
  SHA512:
6
- metadata.gz: 6350e4c3b8ba82b72c5685d2317ad036b1663c0eeb23e8b518e4ea2e165b886f1641626a56b51d7981374548899060633b2fbf93b4cfa3351c1bf3b2393c31c2
7
- data.tar.gz: b9d99a95d839850feb52e5b70f90f44cbd72d72063fda2a668f02359365cc4d774af51e45044237fa13af46b6c287a4bd5ac807b5a3cd92028c7fa04c3e220f5
6
+ metadata.gz: 6bf88fd9f812ce956b184038a66236e7c8a21bac03b2361a049cc5c9e3417dfd4069747152dc1c07f3926bac9abeb535b86cd81b753b290608aeb44ec915a427
7
+ data.tar.gz: 5110822e50b9d75fac3f04c25008a6ac6a4f8753908df88d78b3b848b3b1275d36cded90fed8bbdb052e699f0e1f3157861839dff04deaf1a4414a4f5c189f88
@@ -1,3 +1,3 @@
1
1
  module Canzea
2
- VERSION = "0.1.20"
2
+ VERSION = "0.1.21"
3
3
  end
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
- publicIp = File.read("#{Canzea::config[:pwd]}/vps-#{opts[:serverBase]}-#{opts[:serverNumber]}.json")
130
- remote = RemoteCall.new
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
- RemoteRun.new.do opts[:serverBase], opts[:serverNumber], opts[:privateKey], opts[:role], opts[:solution]
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
@@ -4,8 +4,7 @@ require "pathname"
4
4
  require "ssh-base-cmd-class"
5
5
 
6
6
  class RemoteRun
7
- def do(serverBase, serverNumber, privateKey, role, solution)
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
@@ -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.20
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