avm-eac_ubuntu_base0 0.1.0 → 0.3.0

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: '0458409a75617694a688f070514704e9bfa76f4455878410c5be04558f98b55e'
4
- data.tar.gz: d4f93d4d02fdd2bef2d7b5b4969392ba3b7e0f4c22c9fbf0964abcb9842a6db3
3
+ metadata.gz: 68c659397d70f0b0b46d7bdb3398413bf313cedc2582215a6f8a12e7fba79f58
4
+ data.tar.gz: d4a64bcbc6b0a0310c2f0fb18fd03882c56294119181eae37e9021e01d0f70e2
5
5
  SHA512:
6
- metadata.gz: 0dd402dd2f54671756ce27651734dcf44ccf3c8dc6740fd7478a0aa298edea6995b0e0168f7baaa5324a72f9a7e91db4746735e8ecba2ba3ea4a2254cc7af12b
7
- data.tar.gz: c7c0b33f4bf7dc09bfa27f25b49a31634b715fe7d775d0a1bb34857a2707071052af482fd73acd527a5612dd0dc2d32fa1b16fd7df2bc014427dc6aed78c1043
6
+ metadata.gz: 49755ee661da708823681e16589c53c1d5b4786e040f536f38986b6a690691914ad682537e45248dce5f75b4cb03dd29492b24414bd2e233bca7f15d4c0a58c0
7
+ data.tar.gz: 03b7115d14f0a177f851adce03ef0e1acb095411f3542a43873d140543109a319b29d930141636df6f9a30eb86e04f0bbca40eb646e8bd04084384e48c2a5ed0
@@ -1,15 +1,29 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'avm/docker/image'
4
- require 'avm/eac_ubuntu_base0/patches/object/template'
4
+ require 'eac_templates/from_all_gems'
5
5
  require 'eac_ruby_utils/core_ext'
6
6
 
7
7
  module Avm
8
8
  module EacUbuntuBase0
9
9
  class DockerImage < ::Avm::Docker::Image
10
+ USER_NAME = 'myuser'
11
+
10
12
  def stereotype_tag
11
13
  'eac_ubuntu_base0'
12
14
  end
15
+
16
+ def user_home
17
+ ::File.join('/home', user_name)
18
+ end
19
+
20
+ def user_name
21
+ USER_NAME
22
+ end
23
+
24
+ def user_password
25
+ user_name
26
+ end
13
27
  end
14
28
  end
15
29
  end
@@ -10,6 +10,12 @@ module Avm
10
10
  def docker_image_class
11
11
  ::Avm::EacUbuntuBase0::DockerImage
12
12
  end
13
+
14
+ def file_sudo_write(path, content)
15
+ ::EacRubyUtils::Envs.local.command('echo', content).pipe(
16
+ host_env.command('sudo', 'tee', path)
17
+ ).execute!
18
+ end
13
19
  end
14
20
  end
15
21
  end
@@ -13,6 +13,10 @@ module Avm
13
13
 
14
14
  INSTANCE_ID = 'eac-ubuntu-base0_self'
15
15
 
16
+ runner_with :help, :subcommands do
17
+ subcommands
18
+ end
19
+
16
20
  private
17
21
 
18
22
  def instance_uncached
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacUbuntuBase0
5
- VERSION = '0.1.0'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
@@ -0,0 +1,24 @@
1
+ FROM ubuntu:20.04
2
+
3
+ # Base system update
4
+ RUN apt-get update -y
5
+ RUN apt-get dist-upgrade -y
6
+
7
+ # Timezone
8
+ RUN apt-get install -y tzdata
9
+ RUN ln -fs /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime
10
+ RUN dpkg-reconfigure --frontend noninteractive tzdata
11
+
12
+ # Default user
13
+ RUN /usr/sbin/useradd --shell /bin/bash --home-dir %%user_home%% --create-home %%user_name%%
14
+ RUN /bin/echo '%%user_name%%:%%user_password%%' | /usr/sbin/chpasswd
15
+ RUN /bin/chown %%user_name%%:%%user_name%% %%user_home%% -R
16
+
17
+ # Sudo
18
+ RUN apt-get install -y sudo
19
+ RUN /bin/echo "%%user_name%% ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/%%user_name%%_all_nopasswd && chmod 0440 /etc/sudoers.d/%%user_name%%_all_nopasswd
20
+
21
+ # Container
22
+ USER %%user_name%%
23
+ WORKDIR %%user_home%%
24
+ CMD /bin/bash
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.1.0
4
+ version: 0.3.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: 2021-11-04 00:00:00.000000000 Z
11
+ date: 2022-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm
@@ -50,14 +50,14 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.2'
53
+ version: '0.3'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '0.2'
60
+ version: '0.3'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: eac_ruby_gem_support
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -84,11 +84,10 @@ files:
84
84
  - lib/avm/eac_ubuntu_base0/docker_image.rb
85
85
  - lib/avm/eac_ubuntu_base0/instances.rb
86
86
  - lib/avm/eac_ubuntu_base0/instances/base.rb
87
- - lib/avm/eac_ubuntu_base0/patches/object/template.rb
88
87
  - lib/avm/eac_ubuntu_base0/runners/base.rb
89
88
  - lib/avm/eac_ubuntu_base0/runners/base/docker.rb
90
89
  - lib/avm/eac_ubuntu_base0/version.rb
91
- - template/avm/eac_ubuntu_base0/docker_image/Dockerfile
90
+ - template/avm/eac_ubuntu_base0/docker_image/Dockerfile.template
92
91
  homepage:
93
92
  licenses: []
94
93
  metadata: {}
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
- require 'eac_templates/patches/object/template'
5
-
6
- ::EacTemplates::Searcher.default.included_paths <<
7
- __dir__.to_pathname.expand_path.parent_n(5).join('template')
@@ -1,11 +0,0 @@
1
- FROM ubuntu:20.04
2
- RUN apt-get update -y
3
- RUN apt-get install -y sudo tzdata
4
- RUN /usr/sbin/useradd --shell /bin/bash --home-dir /home/myuser --create-home myuser
5
- RUN /bin/echo 'myuser:myuser' | /usr/sbin/chpasswd
6
- RUN /bin/chown myuser:myuser /home/myuser -R
7
- RUN /bin/echo "myuser ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/myuser_all_nopasswd && chmod 0440 /etc/sudoers.d/myuser_all_nopasswd
8
- USER myuser
9
- WORKDIR /home/myuser
10
- ENTRYPOINT /bin/bash
11
- CMD apt-get update -y && apt-get dist-upgrade -y