swarm_cluster_cli_ope 0.8 → 0.8.2
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/Dockerfile +39 -0
- data/Gemfile.lock +6 -6
- data/lib/swarm_cluster_cli_ope/kubernetes/sync_configs/rsync.rb +11 -4
- data/lib/swarm_cluster_cli_ope/version.rb +1 -1
- data/swarm_cluster_cli_ope.gemspec +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 29de31a0f085b69240832ed83a3446c3fff132ccf0f9b101c2553a5dfab2214c
|
|
4
|
+
data.tar.gz: 8a2d300784f7fc94e67b970bea4541acfbcbc530de40ad237044722beab4534f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 48791785b32e282685f206a7126c768e0c5feaccbc791aef1fe70da008d1ed37468080ff25a966034b18b9efe64152aff53a7c7465d1394bff277507a56bad07
|
|
7
|
+
data.tar.gz: 36b9ab907827fbd86941ef4c4f30c591fa45e7b303d11ba5376300df7b652002eeb984671ba4a3be1aa2ee8cd09a164ab5ab3758d3fb7d5a65b554e06c7144e7
|
data/Dockerfile
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# syntax = docker/dockerfile:1.4
|
|
2
|
+
|
|
3
|
+
#imagine per fare la build della gemma
|
|
4
|
+
FROM ruby:2.7 as building
|
|
5
|
+
|
|
6
|
+
RUN mkdir /builder
|
|
7
|
+
WORKDIR /builder
|
|
8
|
+
COPY . .
|
|
9
|
+
RUN gem build swarm_cluster_cli_ope.gemspec -o swarm_cluster_cli_ope.gem
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
FROM ruby:2.7
|
|
13
|
+
LABEL authors="Marino Bonetti"
|
|
14
|
+
|
|
15
|
+
RUN apt update && apt install -y docker
|
|
16
|
+
|
|
17
|
+
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \
|
|
18
|
+
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
|
|
19
|
+
|
|
20
|
+
RUN wget https://github.com/digitalocean/doctl/releases/download/v1.94.0/doctl-1.94.0-linux-amd64.tar.gz && \
|
|
21
|
+
tar xf doctl-1.94.0-linux-amd64.tar.gz && \
|
|
22
|
+
mv doctl /usr/local/bin
|
|
23
|
+
|
|
24
|
+
RUN mkdir -p /home/nobody && chmod 777 /home/nobody
|
|
25
|
+
ENV HOME="/home/nobody"
|
|
26
|
+
ENV USER=nobody
|
|
27
|
+
|
|
28
|
+
#COPY --from=building /builder/swarm_cluster_cli_ope.gem .
|
|
29
|
+
#RUN gem install --user-install ./swarm_cluster_cli_ope.gem # swarm_cluster_cli_ope
|
|
30
|
+
RUN mkdir /builder && cd /builder
|
|
31
|
+
COPY . .
|
|
32
|
+
RUN bundle install && bundle exec rake install
|
|
33
|
+
RUN chmod -R ugo+rwt /usr/local/bundle
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# qua andremo a montare la $PWD
|
|
37
|
+
WORKDIR /application
|
|
38
|
+
|
|
39
|
+
#ENTRYPOINT ["swarm_cli_ope"]
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
swarm_cluster_cli_ope (0.8)
|
|
4
|
+
swarm_cluster_cli_ope (0.8.2)
|
|
5
5
|
activesupport (< 7)
|
|
6
6
|
open4
|
|
7
7
|
thor (~> 1.0)
|
|
@@ -10,22 +10,22 @@ PATH
|
|
|
10
10
|
GEM
|
|
11
11
|
remote: https://rubygems.org/
|
|
12
12
|
specs:
|
|
13
|
-
activesupport (6.1.7
|
|
13
|
+
activesupport (6.1.7)
|
|
14
14
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
15
15
|
i18n (>= 1.6, < 2)
|
|
16
16
|
minitest (>= 5.1)
|
|
17
17
|
tzinfo (~> 2.0)
|
|
18
18
|
zeitwerk (~> 2.3)
|
|
19
19
|
concurrent-ruby (1.2.2)
|
|
20
|
-
i18n (1.
|
|
20
|
+
i18n (1.12.0)
|
|
21
21
|
concurrent-ruby (~> 1.0)
|
|
22
22
|
minitest (5.18.0)
|
|
23
23
|
open4 (1.3.4)
|
|
24
24
|
rake (12.3.3)
|
|
25
|
-
thor (1.2.
|
|
25
|
+
thor (1.2.1)
|
|
26
26
|
tzinfo (2.0.6)
|
|
27
27
|
concurrent-ruby (~> 1.0)
|
|
28
|
-
zeitwerk (2.6.
|
|
28
|
+
zeitwerk (2.6.7)
|
|
29
29
|
|
|
30
30
|
PLATFORMS
|
|
31
31
|
ruby
|
|
@@ -35,4 +35,4 @@ DEPENDENCIES
|
|
|
35
35
|
swarm_cluster_cli_ope!
|
|
36
36
|
|
|
37
37
|
BUNDLED WITH
|
|
38
|
-
2.
|
|
38
|
+
2.3.7
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
require 'fileutils'
|
|
2
|
+
require 'tmpdir'
|
|
3
|
+
|
|
1
4
|
module SwarmClusterCliOpe
|
|
2
5
|
module Kubernetes
|
|
3
6
|
module SyncConfigs
|
|
@@ -88,19 +91,22 @@ module SwarmClusterCliOpe
|
|
|
88
91
|
pid = p.pid
|
|
89
92
|
say "PID in execuzione port forward:#{pid}"
|
|
90
93
|
|
|
94
|
+
# directory temporanea dove salvare pa pwd
|
|
95
|
+
pwd_dir = Dir.mktmpdir
|
|
91
96
|
begin
|
|
92
97
|
|
|
93
98
|
sleep 1
|
|
94
99
|
|
|
95
|
-
#
|
|
96
|
-
|
|
97
|
-
|
|
100
|
+
# creo il file password temporaneo
|
|
101
|
+
tmp_file_path = File.join(pwd_dir,"password")
|
|
102
|
+
FileUtils.copy(configs_path("password"),tmp_file_path)
|
|
103
|
+
FileUtils.chmod(0600,tmp_file_path)
|
|
98
104
|
|
|
99
105
|
# lanciamo il comando quindi per far rsync
|
|
100
106
|
rsync_command = [
|
|
101
107
|
"rsync -az --no-o --no-g",
|
|
102
108
|
"--delete",
|
|
103
|
-
"--password-file=#{
|
|
109
|
+
"--password-file=#{tmp_file_path}"
|
|
104
110
|
]
|
|
105
111
|
|
|
106
112
|
if direction == :up
|
|
@@ -119,6 +125,7 @@ module SwarmClusterCliOpe
|
|
|
119
125
|
sleep 1
|
|
120
126
|
say "Stoppo porta forwarded"
|
|
121
127
|
Process.kill("INT", pid)
|
|
128
|
+
FileUtils.remove_entry pwd_dir
|
|
122
129
|
end
|
|
123
130
|
ensure
|
|
124
131
|
say "Tolgo il servizio di rsyn"
|
|
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
|
23
23
|
# Specify which files should be added to the gem when it is released.
|
|
24
24
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
25
25
|
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
|
26
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|test_folder)/}) }
|
|
26
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|test_folder|Dockerfile)/}) }
|
|
27
27
|
end
|
|
28
28
|
spec.bindir = "exe"
|
|
29
29
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: swarm_cluster_cli_ope
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 0.8.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Marino Bonetti
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-07-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|
|
@@ -81,6 +81,7 @@ files:
|
|
|
81
81
|
- ".ruby-gemset"
|
|
82
82
|
- ".ruby-version"
|
|
83
83
|
- CHANGELOG.md
|
|
84
|
+
- Dockerfile
|
|
84
85
|
- Gemfile
|
|
85
86
|
- Gemfile.lock
|
|
86
87
|
- LICENSE.txt
|
|
@@ -158,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
158
159
|
- !ruby/object:Gem::Version
|
|
159
160
|
version: '0'
|
|
160
161
|
requirements: []
|
|
161
|
-
rubygems_version: 3.
|
|
162
|
+
rubygems_version: 3.3.5
|
|
162
163
|
signing_key:
|
|
163
164
|
specification_version: 4
|
|
164
165
|
summary: WIP Gemma per la gestione del cluster swarm
|