harbr 0.2.6 → 0.2.7
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/exe/harbr +5 -0
- data/lib/harbr/lxd/job.rb +1 -1
- data/lib/harbr/lxd/setup.rb +45 -0
- data/lib/harbr/version.rb +1 -1
- data/lib/harbr.rb +2 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dadfff78b63601cdf6b8764d893aef44c40825dedb37cfd986794cf3c108cee8
|
4
|
+
data.tar.gz: cca2020198ca945ec0bf2bfcf3900857b3bf3fd5c27f21a1ecad9ca97eb017be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa387f6108ae537edbde1177495c3a383bdefd1b0352dac0d272e6c2f31efea3c0baafd56ea34d5aa009b2956ccd86e07a192c3c35ed31d3f9998e031125e92d
|
7
|
+
data.tar.gz: 2f600fea29940389b892c4a2b4d6d7351b8b3c6cbaa1c1b7dc0d7e4f10d773900726b4eb2de905206d8d521c2029a217c61409306ac0ec66fba98157333165b4
|
data/exe/harbr
CHANGED
@@ -135,6 +135,11 @@ class HarbrCLI < Thor
|
|
135
135
|
install_with_snap("ruby") unless command_exists?("ruby")
|
136
136
|
install_with_snap("traefik") unless command_exists?("traefik")
|
137
137
|
install_with_apt("runit") unless command_exists?("runit")
|
138
|
+
install_with_apt("lxc") unless command_exists?("lxc")
|
139
|
+
|
140
|
+
Harbr::Lxd::Setup.perform("panamax")
|
141
|
+
|
142
|
+
|
138
143
|
puts "Setup completed successfully."
|
139
144
|
end
|
140
145
|
|
data/lib/harbr/lxd/job.rb
CHANGED
@@ -56,7 +56,7 @@ module Harbr
|
|
56
56
|
raise "Source path #{source_path} does not exist." unless File.directory?(source_path)
|
57
57
|
|
58
58
|
# Create the container
|
59
|
-
system("lxc launch
|
59
|
+
system("lxc launch panamax #{name}")
|
60
60
|
sleep(5) # Wait for the container to initialize
|
61
61
|
|
62
62
|
# Check if runit is installed, if not then install
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Harbr
|
2
|
+
module Lxd
|
3
|
+
class Setup
|
4
|
+
include SuckerPunch::Job
|
5
|
+
|
6
|
+
def perform(name)
|
7
|
+
# Create the container
|
8
|
+
system("lxc launch ubuntu:20.04 #{name}")
|
9
|
+
sleep(5) # Wait for the container to initialize
|
10
|
+
|
11
|
+
# Check if runit is installed, if not then install
|
12
|
+
unless system("lxc exec #{name} -- dpkg -s runit")
|
13
|
+
system("lxc exec #{name} -- apt-get update")
|
14
|
+
system("lxc exec #{name} -- apt-get install -y runit")
|
15
|
+
end
|
16
|
+
|
17
|
+
# Check if chruby is installed, if not then install chruby, ruby-install and Ruby versions
|
18
|
+
unless system("lxc exec #{name} -- bash -c 'type chruby'")
|
19
|
+
system("lxc exec #{name} -- apt-get install -y git curl build-essential zlib1g-dev libssl-dev libreadline-dev libyaml-dev libgdbm-dev libncurses5-dev libffi-dev")
|
20
|
+
system("lxc exec #{name} -- wget -O chruby-0.3.9.tar.gz https://github.com/postmodern/chruby/archive/v0.3.9.tar.gz")
|
21
|
+
system("lxc exec #{name} -- tar -xzvf chruby-0.3.9.tar.gz")
|
22
|
+
system("lxc exec #{name} -- cd chruby-0.3.9/ && make install")
|
23
|
+
system("lxc exec #{name} -- echo 'source /usr/local/share/chruby/chruby.sh' >> ~/.bashrc")
|
24
|
+
system("lxc exec #{name} -- wget -O ruby-install-0.8.3.tar.gz https://github.com/postmodern/ruby-install/archive/v0.8.3.tar.gz")
|
25
|
+
system("lxc exec #{name} -- tar -xzvf ruby-install-0.8.3.tar.gz")
|
26
|
+
system("lxc exec #{name} -- cd ruby-install-0.8.3/ && make install")
|
27
|
+
|
28
|
+
# Install Ruby versions
|
29
|
+
["3.2.2", "3.1.2", "3.3.0"].each do |ruby_version|
|
30
|
+
system("lxc exec #{name} -- ruby-install ruby #{ruby_version}")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
puts "Container #{name} created."
|
35
|
+
|
36
|
+
# Publish the container as an image named "panamax"
|
37
|
+
system("lxc stop #{name}")
|
38
|
+
system("lxc publish #{name} --alias @#{name}")
|
39
|
+
|
40
|
+
puts "panamax image #{name} published."
|
41
|
+
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/lib/harbr/version.rb
CHANGED
data/lib/harbr.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: harbr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Delaney Kuldvee Burke
|
@@ -151,6 +151,7 @@ files:
|
|
151
151
|
- lib/harbr/container.rb
|
152
152
|
- lib/harbr/job.rb
|
153
153
|
- lib/harbr/lxd/job.rb
|
154
|
+
- lib/harbr/lxd/setup.rb
|
154
155
|
- lib/harbr/version.rb
|
155
156
|
- sig/harbr.rbs
|
156
157
|
- vendor/bundle/ruby/3.2.0/bin/bundle
|