avm-eac_ubuntu_base0 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/eac_ubuntu_base0/rspec/ssh_docker_server.rb +84 -0
- data/lib/avm/eac_ubuntu_base0/rspec.rb +11 -0
- data/lib/avm/eac_ubuntu_base0/version.rb +1 -1
- data/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/Dockerfile +24 -0
- data/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/id_rsa +27 -0
- data/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/id_rsa.pub +1 -0
- metadata +31 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82c5c94dd7af500c1f6903363e07e141bc5978d8f8fc20f4b5487e7123e4b624
|
4
|
+
data.tar.gz: f82db5ddafcc221d3224e102e156e0cb6853070329c005676b13b9cb87e52369
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb7af6ba88a0f0abb5f707f82b1a9ce27ba7710e2656a85c1a220601852dd538f4e22343712f04065ec52bc99c8a287f15d19766f12f85658a37ae0809a34f17
|
7
|
+
data.tar.gz: 9b5bcddbcfe27246c59b311f9f1594df0281b1aae30e88446fd73a8d0b500645103103cdf421f3263959c6e122f13b4bcc15a4147119916c2f5665f03cff56bc
|
@@ -0,0 +1,84 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_docker/images/templatized'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
require 'eac_templates/core_ext'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module EacUbuntuBase0
|
9
|
+
module Rspec
|
10
|
+
class SshDockerServer < ::EacDocker::Images::Templatized
|
11
|
+
# @return [EacRubyUtils::Envs::SshEnv]
|
12
|
+
def env
|
13
|
+
raise '@env is blank' if @env.blank?
|
14
|
+
|
15
|
+
@env
|
16
|
+
end
|
17
|
+
|
18
|
+
def on_run
|
19
|
+
on_container do
|
20
|
+
on_env do
|
21
|
+
yield
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def container
|
29
|
+
raise '@container is blank' if @container.blank?
|
30
|
+
|
31
|
+
@container
|
32
|
+
end
|
33
|
+
|
34
|
+
def env_identity_file
|
35
|
+
template.child('id_rsa').path
|
36
|
+
end
|
37
|
+
|
38
|
+
def env_identity_file_good_permissions
|
39
|
+
r = ::EacRubyUtils::Fs::Temp.file
|
40
|
+
::FileUtils.cp env_identity_file, r
|
41
|
+
r.chmod(0o600)
|
42
|
+
r
|
43
|
+
end
|
44
|
+
|
45
|
+
def close_env
|
46
|
+
@identity_file.remove
|
47
|
+
@env = nil
|
48
|
+
end
|
49
|
+
|
50
|
+
def on_env
|
51
|
+
open_env
|
52
|
+
begin
|
53
|
+
yield
|
54
|
+
ensure
|
55
|
+
close_env
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def on_container
|
60
|
+
provide.container.temporary(true).on_detached do |container|
|
61
|
+
@container = container
|
62
|
+
begin
|
63
|
+
yield
|
64
|
+
ensure
|
65
|
+
@container = nil
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def open_env
|
71
|
+
raise 'Environment already open' if @env.present?
|
72
|
+
|
73
|
+
@identity_file = env_identity_file_good_permissions
|
74
|
+
@env = ::EacRubyUtils::Envs::SshEnv.new(
|
75
|
+
"ssh://root@#{container.hostname}" \
|
76
|
+
'?StrictHostKeyChecking=no' \
|
77
|
+
'&BatchMode=yes' \
|
78
|
+
"&IdentityFile=#{@identity_file}"
|
79
|
+
)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
FROM ubuntu:18.04
|
2
|
+
MAINTAINER Aleksandar Diklic "https://github.com/rastasheep"
|
3
|
+
|
4
|
+
RUN apt-get update
|
5
|
+
|
6
|
+
RUN apt-get install -y openssh-server
|
7
|
+
RUN mkdir /var/run/sshd
|
8
|
+
|
9
|
+
RUN echo 'root:root' |chpasswd
|
10
|
+
|
11
|
+
RUN sed -ri 's/^#?PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config
|
12
|
+
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
|
13
|
+
|
14
|
+
RUN mkdir /root/.ssh
|
15
|
+
ADD id_rsa /root/.ssh/id_rsa
|
16
|
+
ADD id_rsa.pub /root/.ssh/id_rsa.pub
|
17
|
+
ADD id_rsa.pub /root/.ssh/authorized_keys
|
18
|
+
|
19
|
+
RUN apt-get clean && \
|
20
|
+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
21
|
+
|
22
|
+
EXPOSE 22
|
23
|
+
|
24
|
+
CMD ["/usr/sbin/sshd", "-D"]
|
@@ -0,0 +1,27 @@
|
|
1
|
+
-----BEGIN RSA PRIVATE KEY-----
|
2
|
+
MIIEowIBAAKCAQEAyZfl6Z+r/Is396PdKgYEWAf0O2xt7a1UwlaP7ozRvZjmmd/X
|
3
|
+
dkPo2ZsXe7tACAJzDHMO9UO1/WQ0ZirkVfLTe82CInwggYLxEf1vRtCV1NuVtttZ
|
4
|
+
+D0yZWb/kXEApVAIzKvCBPZJuspBPuJcEuVygJn646WXqi1X3CBDqV+YEI8sm1o3
|
5
|
+
xn9xmsyXmW7AfIT07F1W6u4/vfGnZ3zjyXwA0ef1wZ46RgzFgVTBZOnpf0ELjcW0
|
6
|
+
VRfvgGRytoY22pvqxtYc5Yumgddp2oi3fUKMoRrDAwU7+VFKUQv0XmMsZKKp2iei
|
7
|
+
hl/WRI9ScXs16QNQZqVqnw9ll2aUaPVVf1Jk4QIDAQABAoIBADDiWKoyQe5XhBbU
|
8
|
+
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uxrsMwEIrzP3j8Ln5Bc0wpzjSUWxaFcBeYs1hPzhhLib
|
23
|
+
j5jZk0VATJPl+XqHnvR2crhkz5xbsR6uvkO1JfLH/D9OeoITVBpz1Ui9QSCA4k8O
|
24
|
+
Etw1AoGBAKRMXd+BxObb7+Qr0QSSjsAo2/5Ca782X1G8LoXkKqXqSiY+Y98ugpoC
|
25
|
+
Gu+oeiHLHDW47hHbtC5rdXigcLEZQRiLVsOiwgua8AcnQxBhF4/Xi877+C8hB7ge
|
26
|
+
JjlolpGpvjYN3QEnYxki4Fbgxxz4PX91NjnT5RF4dILhTa5kavP7
|
27
|
+
-----END RSA PRIVATE KEY-----
|
@@ -0,0 +1 @@
|
|
1
|
+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJl+Xpn6v8izf3o90qBgRYB/Q7bG3trVTCVo/ujNG9mOaZ39d2Q+jZmxd7u0AIAnMMcw71Q7X9ZDRmKuRV8tN7zYIifCCBgvER/W9G0JXU25W221n4PTJlZv+RcQClUAjMq8IE9km6ykE+4lwS5XKAmfrjpZeqLVfcIEOpX5gQjyybWjfGf3GazJeZbsB8hPTsXVbq7j+98adnfOPJfADR5/XBnjpGDMWBVMFk6el/QQuNxbRVF++AZHK2hjbam+rG1hzli6aB12naiLd9QoyhGsMDBTv5UUpRC/ReYyxkoqnaJ6KGX9ZEj1JxezXpA1BmpWqfD2WXZpRo9VV/UmTh avm@localhost
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avm-eac_ubuntu_base0
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Put here the authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avm
|
@@ -16,34 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.57'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.57'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: eac_ruby_utils
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
34
|
-
- - ">="
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: 0.77.1
|
33
|
+
version: '0.109'
|
37
34
|
type: :runtime
|
38
35
|
prerelease: false
|
39
36
|
version_requirements: !ruby/object:Gem::Requirement
|
40
37
|
requirements:
|
41
38
|
- - "~>"
|
42
39
|
- !ruby/object:Gem::Version
|
43
|
-
version: '0.
|
44
|
-
- - ">="
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: 0.77.1
|
40
|
+
version: '0.109'
|
47
41
|
- !ruby/object:Gem::Dependency
|
48
42
|
name: eac_templates
|
49
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -51,6 +45,9 @@ dependencies:
|
|
51
45
|
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0.3'
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: 0.3.2
|
54
51
|
type: :runtime
|
55
52
|
prerelease: false
|
56
53
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,6 +55,23 @@ dependencies:
|
|
58
55
|
- - "~>"
|
59
56
|
- !ruby/object:Gem::Version
|
60
57
|
version: '0.3'
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 0.3.2
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: avm-eac_ubuntu_base0
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
61
75
|
- !ruby/object:Gem::Dependency
|
62
76
|
name: eac_ruby_gem_support
|
63
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,10 +98,15 @@ files:
|
|
84
98
|
- lib/avm/eac_ubuntu_base0/docker_image.rb
|
85
99
|
- lib/avm/eac_ubuntu_base0/instances.rb
|
86
100
|
- lib/avm/eac_ubuntu_base0/instances/base.rb
|
101
|
+
- lib/avm/eac_ubuntu_base0/rspec.rb
|
102
|
+
- lib/avm/eac_ubuntu_base0/rspec/ssh_docker_server.rb
|
87
103
|
- lib/avm/eac_ubuntu_base0/runners/base.rb
|
88
104
|
- lib/avm/eac_ubuntu_base0/runners/base/docker.rb
|
89
105
|
- lib/avm/eac_ubuntu_base0/version.rb
|
90
106
|
- template/avm/eac_ubuntu_base0/docker_image/Dockerfile.template
|
107
|
+
- template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/Dockerfile
|
108
|
+
- template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/id_rsa
|
109
|
+
- template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/id_rsa.pub
|
91
110
|
homepage:
|
92
111
|
licenses: []
|
93
112
|
metadata: {}
|