swarm_cluster_cli_ope 0.8 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f00895cd03d34e2cf7d02fa91afa20a5be260d9f953d0e41b51cec2645775d0e
4
- data.tar.gz: '0778a28b40f1babd5a00ac9fd3c1d600e63b8a287294884736c9b5b713e9d3f8'
3
+ metadata.gz: 3b8ca6327409b45e532d4d3c2cce4dbde5bf8819fe909bafeb4690331391c233
4
+ data.tar.gz: 95cfc42f92f208e3c22febe63994cbec6a9af896131f967a2a97c9836ac4c677
5
5
  SHA512:
6
- metadata.gz: 438bd6491e38336904741c9655c6046e280c4cfb96c63d44b50ee8d299255e589517134d1ff1611fadcdee3854680a09916c612643f07e1e29a894efb0d0b61c
7
- data.tar.gz: 5dcad79599174d9b547a2338700600acb321762ffbe2802210aa9a9ccf252e793f1b636da4dd75c34a474bfb0de724843de3012b16849454831fe1006652c7ec
6
+ metadata.gz: c7c3c7904a3862d17359b57c052d54caee5eb109894f11685938175966211a389d8bf58ce557e02f9ddcb2af9dacd7d6f89e8addb1d46697a4bd0687a1e54b01
7
+ data.tar.gz: 340d0256ea1b3d1b396a316df8ae072914d4fda3a906efa67b138e4795370e1361dec2d2fc51aec97fd92881e37c338399c1701087a4d746570eefd0f03cb044
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.1)
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.3)
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.14.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.2)
25
+ thor (1.2.1)
26
26
  tzinfo (2.0.6)
27
27
  concurrent-ruby (~> 1.0)
28
- zeitwerk (2.6.8)
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.1.4
38
+ 2.3.7
@@ -1,3 +1,5 @@
1
+ require 'fileutils'
2
+
1
3
  module SwarmClusterCliOpe
2
4
  module Kubernetes
3
5
  module SyncConfigs
@@ -88,19 +90,22 @@ module SwarmClusterCliOpe
88
90
  pid = p.pid
89
91
  say "PID in execuzione port forward:#{pid}"
90
92
 
93
+ # directory temporanea dove salvare pa pwd
94
+ pwd_dir = Dir.mktmpdir
91
95
  begin
92
96
 
93
97
  sleep 1
94
98
 
95
- # forzo i permessi sul file della password
96
- cmd = ShellCommandExecution.new(["chmod 600 #{ configs_path("password")}"])
97
- cmd.execute
99
+ # creo il file password temporaneo
100
+ tmp_file_path = File.join(pwd_dir,"password")
101
+ FileUtils.copy(configs_path("password"),tmp_file_path)
102
+ FileUtils.chmod(0600,tmp_file_path)
98
103
 
99
104
  # lanciamo il comando quindi per far rsync
100
105
  rsync_command = [
101
106
  "rsync -az --no-o --no-g",
102
107
  "--delete",
103
- "--password-file=#{ configs_path("password")}"
108
+ "--password-file=#{tmp_file_path}"
104
109
  ]
105
110
 
106
111
  if direction == :up
@@ -119,6 +124,7 @@ module SwarmClusterCliOpe
119
124
  sleep 1
120
125
  say "Stoppo porta forwarded"
121
126
  Process.kill("INT", pid)
127
+ FileUtils.remove_entry pwd_dir
122
128
  end
123
129
  ensure
124
130
  say "Tolgo il servizio di rsyn"
@@ -1,3 +1,3 @@
1
1
  module SwarmClusterCliOpe
2
- VERSION = "0.8"
2
+ VERSION = "0.8.1"
3
3
  end
@@ -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: '0.8'
4
+ version: 0.8.1
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-06-13 00:00:00.000000000 Z
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.1.6
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