vanagon 0.20.1 → 0.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/lib/vanagon/cli/list.rb +11 -0
  3. data/lib/vanagon/platform/defaults/debian-10-amd64.rb +11 -0
  4. data/lib/vanagon/platform/defaults/debian-8-amd64.rb +12 -0
  5. data/lib/vanagon/platform/defaults/debian-8-i386.rb +12 -0
  6. data/lib/vanagon/platform/defaults/debian-9-amd64.rb +12 -0
  7. data/lib/vanagon/platform/defaults/debian-9-i386.rb +12 -0
  8. data/lib/vanagon/platform/defaults/el-6-i386.rb +11 -0
  9. data/lib/vanagon/platform/defaults/el-6-x86_64.rb +11 -0
  10. data/lib/vanagon/platform/defaults/el-7-aarch64.rb +13 -0
  11. data/lib/vanagon/platform/defaults/el-7-x86_64.rb +11 -0
  12. data/lib/vanagon/platform/defaults/el-8-aarch64.rb +10 -0
  13. data/lib/vanagon/platform/defaults/el-8-x86_64.rb +10 -0
  14. data/lib/vanagon/platform/defaults/fedora-30-x86_64.rb +11 -0
  15. data/lib/vanagon/platform/defaults/fedora-31-x86_64.rb +11 -0
  16. data/lib/vanagon/platform/defaults/fedora-32-x86_64.rb +11 -0
  17. data/lib/vanagon/platform/defaults/osx-10.14-x86_64.rb +22 -0
  18. data/lib/vanagon/platform/defaults/osx-10.15-x86_64.rb +21 -0
  19. data/lib/vanagon/platform/defaults/redhatfips-7-x86_64.rb +11 -0
  20. data/lib/vanagon/platform/defaults/sles-12-x86_64.rb +11 -0
  21. data/lib/vanagon/platform/defaults/sles-15-x86_64.rb +10 -0
  22. data/lib/vanagon/platform/defaults/solaris-11-i386.rb +9 -0
  23. data/lib/vanagon/platform/defaults/solaris-11-sparc.rb +10 -0
  24. data/lib/vanagon/platform/defaults/ubuntu-16.04-amd64.rb +12 -0
  25. data/lib/vanagon/platform/defaults/ubuntu-16.04-i386.rb +12 -0
  26. data/lib/vanagon/platform/defaults/ubuntu-18.04-amd64.rb +12 -0
  27. data/lib/vanagon/platform/defaults/ubuntu-20.04-aarch64.rb +11 -0
  28. data/lib/vanagon/platform/defaults/ubuntu-20.04-amd64.rb +11 -0
  29. data/lib/vanagon/platform/dsl.rb +7 -0
  30. data/spec/lib/vanagon/cli_spec.rb +56 -5
  31. metadata +56 -30
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8143e33ee3e55783135b3feff210b3b0a9cc84f78ef424b3ea64bc3fb9e2015d
4
- data.tar.gz: 27cb820cfefca81d8eba73bcb050ed70fc01971b69ce104ac4eb2db83e79fb93
3
+ metadata.gz: 1e832c071ba2d54e8c938fbeace5fe1c0287bc25b2ff405b6b2d1ca5dbc9f44f
4
+ data.tar.gz: 1af5c0c38870de680a4cc1f037a94fa6595d22d0e9b70147371650beb11d7130
5
5
  SHA512:
6
- metadata.gz: 5dc62ebe1401f4552390faa8fd53373d9fb124c571714f297665f009497af7684a8dbebdff6833b28514a85b85507b7d764a896b38e79a3a58c7322ab8d3e7e5
7
- data.tar.gz: '0895360b81bd25c4f95877df7514d1a5f1ff87a6e765ad244108c9646ce4fc2a93670a282aabcdc41e5c4881a281ac9739b3f4c1c5b1dee03f4e3c9ff5c98a1b'
6
+ metadata.gz: 53756b8e737fbe884d6e5ce934442778d07407b638d34186c1b19f658981b5e36a79d0c7c272b0efe82a7f86ded6479ab0a5e1fc7962b0112dfd85732168095c
7
+ data.tar.gz: 21b9ebef8bb1d8a54650c4a35551abdf8142d9e28689d843f96278ad81d5081877ec9eb6d4d9432799feb464a2f682754d78d3af6cf4b8c20d17bc0ea3c94145
@@ -11,6 +11,7 @@ class Vanagon
11
11
  Options:
12
12
  -h, --help Display help
13
13
  -c, --configdir DIRECTORY Configuration directory [default: #{Dir.pwd}/configs]
14
+ -d, --defaults Display the list of default platforms
14
15
  -l, --platforms Display a list of platforms
15
16
  -r, --projects Display a list of projects
16
17
  -s, --use-spaces Displays the list as space separated
@@ -36,6 +37,10 @@ class Vanagon
36
37
  exit 1
37
38
  end
38
39
 
40
+ default_list = Dir.children(File.join(File.dirname(__FILE__), '..', 'platform', 'defaults')).map do |platform|
41
+ File.basename(platform, File.extname(platform))
42
+ end
43
+
39
44
  platform_list = Dir.children(File.join(options[:configdir], 'platforms')).map do |platform|
40
45
  File.basename(platform, File.extname(platform))
41
46
  end
@@ -44,6 +49,11 @@ class Vanagon
44
49
  File.basename(project, File.extname(project))
45
50
  end
46
51
 
52
+ if options[:defaults]
53
+ puts "- Defaults", output(default_list, options[:use_spaces])
54
+ return
55
+ end
56
+
47
57
  if options[:projects] == options[:platforms]
48
58
  puts "- Projects", output(project_list, options[:use_spaces]), "\n", "- Platforms", output(platform_list, options[:use_spaces])
49
59
  return
@@ -63,6 +73,7 @@ class Vanagon
63
73
  def options_translate(docopt_options)
64
74
  translations = {
65
75
  '--configdir' => :configdir,
76
+ '--defaults' => :defaults,
66
77
  '--platforms' => :platforms,
67
78
  '--projects' => :projects,
68
79
  '--use-spaces' => :use_spaces,
@@ -0,0 +1,11 @@
1
+ platform "debian-10-amd64" do |plat|
2
+ plat.servicedir "/lib/systemd/system"
3
+ plat.defaultdir "/etc/default"
4
+ plat.servicetype "systemd"
5
+ plat.codename "buster"
6
+
7
+ packages = %w(build-essential devscripts make quilt pkg-config debhelper rsync fakeroot cmake)
8
+ plat.provision_with "export DEBIAN_FRONTEND=noninteractive; apt-get update -qq; apt-get install -qy --no-install-recommends #{packages.join(' ')}"
9
+ plat.install_build_dependencies_with "DEBIAN_FRONTEND=noninteractive; apt-get install -qy --no-install-recommends "
10
+ plat.vmpooler_template "debian-10-x86_64"
11
+ end
@@ -0,0 +1,12 @@
1
+ platform "debian-8-amd64" do |plat|
2
+ plat.servicedir "/lib/systemd/system"
3
+ plat.defaultdir "/etc/default"
4
+ plat.servicetype "systemd"
5
+ plat.codename "jessie"
6
+
7
+ plat.add_build_repository "http://pl-build-tools.delivery.puppetlabs.net/debian/pl-build-tools-release-#{plat.get_codename}.deb"
8
+ packages = %w(build-essential devscripts make quilt pkg-config debhelper rsync fakeroot)
9
+ plat.provision_with "export DEBIAN_FRONTEND=noninteractive; apt-get update -qq; apt-get install -qy --no-install-recommends #{packages.join(' ')}"
10
+ plat.install_build_dependencies_with "DEBIAN_FRONTEND=noninteractive; apt-get install -qy --no-install-recommends "
11
+ plat.vmpooler_template "debian-8-x86_64"
12
+ end
@@ -0,0 +1,12 @@
1
+ platform "debian-8-i386" do |plat|
2
+ plat.servicedir "/lib/systemd/system"
3
+ plat.defaultdir "/etc/default"
4
+ plat.servicetype "systemd"
5
+ plat.codename "jessie"
6
+
7
+ plat.add_build_repository "http://pl-build-tools.delivery.puppetlabs.net/debian/pl-build-tools-release-#{plat.get_codename}.deb"
8
+ packages = %w(build-essential devscripts make quilt pkg-config debhelper rsync fakeroot)
9
+ plat.provision_with "export DEBIAN_FRONTEND=noninteractive; apt-get update -qq; apt-get install -qy --no-install-recommends #{packages.join(' ')}"
10
+ plat.install_build_dependencies_with "DEBIAN_FRONTEND=noninteractive; apt-get install -qy --no-install-recommends"
11
+ plat.vmpooler_template "debian-8-i386"
12
+ end
@@ -0,0 +1,12 @@
1
+ platform "debian-9-amd64" do |plat|
2
+ plat.servicedir "/lib/systemd/system"
3
+ plat.defaultdir "/etc/default"
4
+ plat.servicetype "systemd"
5
+ plat.codename "stretch"
6
+
7
+ plat.add_build_repository "http://pl-build-tools.delivery.puppetlabs.net/debian/pl-build-tools-release-#{plat.get_codename}.deb"
8
+ packages = %w(build-essential devscripts make quilt pkg-config debhelper rsync fakeroot)
9
+ plat.provision_with "export DEBIAN_FRONTEND=noninteractive; apt-get update -qq; apt-get install -qy --no-install-recommends #{packages.join(' ')}"
10
+ plat.install_build_dependencies_with "DEBIAN_FRONTEND=noninteractive; apt-get install -qy --no-install-recommends "
11
+ plat.vmpooler_template "debian-9-x86_64"
12
+ end
@@ -0,0 +1,12 @@
1
+ platform "debian-9-i386" do |plat|
2
+ plat.servicedir "/lib/systemd/system"
3
+ plat.defaultdir "/etc/default"
4
+ plat.servicetype "systemd"
5
+ plat.codename "stretch"
6
+
7
+ plat.add_build_repository "http://pl-build-tools.delivery.puppetlabs.net/debian/pl-build-tools-release-#{plat.get_codename}.deb"
8
+ packages = %w(build-essential devscripts make quilt pkg-config debhelper rsync fakeroot)
9
+ plat.provision_with "export DEBIAN_FRONTEND=noninteractive; apt-get update -qq; apt-get install -qy --no-install-recommends #{packages.join(' ')}"
10
+ plat.install_build_dependencies_with "DEBIAN_FRONTEND=noninteractive; apt-get install -qy --no-install-recommends "
11
+ plat.vmpooler_template "debian-9-i386"
12
+ end
@@ -0,0 +1,11 @@
1
+ platform "el-6-i386" do |plat|
2
+ plat.servicedir "/etc/rc.d/init.d"
3
+ plat.defaultdir "/etc/sysconfig"
4
+ plat.servicetype "sysv"
5
+
6
+ plat.add_build_repository "http://pl-build-tools.delivery.puppetlabs.net/yum/pl-build-tools-release-#{plat.get_os_name}-#{plat.get_os_version}.noarch.rpm"
7
+ packages = %w(autoconf automake createrepo rsync gcc make rpmdevtools rpm-libs yum-utils rpm-sign)
8
+ plat.provision_with "yum install --assumeyes #{packages.join(' ')}"
9
+ plat.install_build_dependencies_with "yum install --assumeyes"
10
+ plat.vmpooler_template "redhat-6-i386"
11
+ end
@@ -0,0 +1,11 @@
1
+ platform "el-6-x86_64" do |plat|
2
+ plat.servicedir "/etc/rc.d/init.d"
3
+ plat.defaultdir "/etc/sysconfig"
4
+ plat.servicetype "sysv"
5
+
6
+ plat.add_build_repository "http://pl-build-tools.delivery.puppetlabs.net/yum/pl-build-tools-release-#{plat.get_os_name}-#{plat.get_os_version}.noarch.rpm"
7
+ packages = %w(autoconf automake createrepo rsync gcc make rpmdevtools rpm-libs yum-utils rpm-sign)
8
+ plat.provision_with "yum install --assumeyes #{packages.join(' ')}"
9
+ plat.install_build_dependencies_with "yum install --assumeyes"
10
+ plat.vmpooler_template "redhat-6-x86_64"
11
+ end
@@ -0,0 +1,13 @@
1
+ platform "el-7-aarch64" do |plat|
2
+ plat.servicedir "/usr/lib/systemd/system"
3
+ plat.defaultdir "/etc/sysconfig"
4
+ plat.servicetype "systemd"
5
+
6
+ plat.add_build_repository "http://pl-build-tools.delivery.puppetlabs.net/yum/el/7/aarch64/pl-build-tools-aarch64.repo"
7
+ plat.add_build_repository "http://pl-build-tools.delivery.puppetlabs.net/yum/el/7/x86_64/pl-build-tools-x86_64.repo"
8
+ packages = %w(autoconf automake createrepo rsync gcc make rpmdevtools rpm-libs yum-utils rpm-sign)
9
+ plat.provision_with "yum install --assumeyes #{packages.join(' ')}"
10
+ plat.install_build_dependencies_with "yum install --assumeyes"
11
+ plat.cross_compiled true
12
+ plat.vmpooler_template "redhat-7-x86_64"
13
+ end
@@ -0,0 +1,11 @@
1
+ platform "el-7-x86_64" do |plat|
2
+ plat.servicedir "/usr/lib/systemd/system"
3
+ plat.defaultdir "/etc/sysconfig"
4
+ plat.servicetype "systemd"
5
+
6
+ plat.add_build_repository "http://pl-build-tools.delivery.puppetlabs.net/yum/pl-build-tools-release-#{plat.get_os_name}-#{plat.get_os_version}.noarch.rpm"
7
+ packages = %w(autoconf automake createrepo rsync gcc make rpmdevtools rpm-libs yum-utils rpm-sign)
8
+ plat.provision_with "yum install --assumeyes #{packages.join(' ')}"
9
+ plat.install_build_dependencies_with "yum install --assumeyes"
10
+ plat.vmpooler_template "redhat-7-x86_64"
11
+ end
@@ -0,0 +1,10 @@
1
+ platform "el-8-aarch64" do |plat|
2
+ plat.servicedir "/usr/lib/systemd/system"
3
+ plat.defaultdir "/etc/sysconfig"
4
+ plat.servicetype "systemd"
5
+
6
+ packages = %w(autoconf automake createrepo gcc gcc-c++ rsync cmake make rpm-libs rpm-build)
7
+ plat.provision_with "dnf install -y --allowerasing #{packages.join(' ')}"
8
+ plat.install_build_dependencies_with "dnf install -y --allowerasing "
9
+ plat.vmpooler_template "redhat-8-arm64"
10
+ end
@@ -0,0 +1,10 @@
1
+ platform "el-8-x86_64" do |plat|
2
+ plat.servicedir "/usr/lib/systemd/system"
3
+ plat.defaultdir "/etc/sysconfig"
4
+ plat.servicetype "systemd"
5
+
6
+ packages = %w(gcc gcc-c++ autoconf automake createrepo rsync cmake make rpm-libs rpm-build rpm-sign libtool)
7
+ plat.provision_with "dnf install -y --allowerasing #{packages.join(' ')}"
8
+ plat.install_build_dependencies_with "dnf install -y --allowerasing "
9
+ plat.vmpooler_template "redhat-8-x86_64"
10
+ end
@@ -0,0 +1,11 @@
1
+ platform "fedora-30-x86_64" do |plat|
2
+ plat.servicedir "/usr/lib/systemd/system"
3
+ plat.defaultdir "/etc/sysconfig"
4
+ plat.servicetype "systemd"
5
+ plat.dist "fc30"
6
+
7
+ packages = %w(autoconf automake createrepo rsync gcc gcc-c++ make rpmdevtools rpm-libs cmake rpm-sign yum-utils)
8
+ plat.provision_with "/usr/bin/dnf install -y --best --allowerasing #{packages.join(' ')}"
9
+ plat.install_build_dependencies_with "/usr/bin/dnf install -y --best --allowerasing"
10
+ plat.vmpooler_template "fedora-30-x86_64"
11
+ end
@@ -0,0 +1,11 @@
1
+ platform "fedora-31-x86_64" do |plat|
2
+ plat.servicedir "/usr/lib/systemd/system"
3
+ plat.defaultdir "/etc/sysconfig"
4
+ plat.servicetype "systemd"
5
+ plat.dist "fc31"
6
+
7
+ packages = %w(autoconf automake cmake createrepo rsync gcc gcc-c++ make rpmdevtools rpm-libs rpm-sign)
8
+ plat.provision_with "/usr/bin/dnf install -y --best --allowerasing #{packages.join(' ')}"
9
+ plat.install_build_dependencies_with "/usr/bin/dnf install -y --best --allowerasing"
10
+ plat.vmpooler_template "fedora-31-x86_64"
11
+ end
@@ -0,0 +1,11 @@
1
+ platform "fedora-32-x86_64" do |plat|
2
+ plat.servicedir "/usr/lib/systemd/system"
3
+ plat.defaultdir "/etc/sysconfig"
4
+ plat.servicetype "systemd"
5
+ plat.dist "fc32"
6
+
7
+ packages = %w(autoconf automake rsync gcc gcc-c++ make rpmdevtools cmake)
8
+ plat.provision_with "/usr/bin/dnf install -y --best --allowerasing #{packages.join(' ')}"
9
+ plat.install_build_dependencies_with "/usr/bin/dnf install -y --best --allowerasing"
10
+ plat.vmpooler_template "fedora-32-x86_64"
11
+ end
@@ -0,0 +1,22 @@
1
+ platform "osx-10.14-x86_64" do |plat|
2
+ plat.servicetype "launchd"
3
+ plat.servicedir "/Library/LaunchDaemons"
4
+ plat.codename "mojave"
5
+
6
+ plat.provision_with "export HOMEBREW_NO_EMOJI=true"
7
+ plat.provision_with "export HOMEBREW_VERBOSE=true"
8
+ plat.provision_with "sudo dscl . -create /Users/test"
9
+ plat.provision_with "sudo dscl . -create /Users/test UserShell /bin/bash"
10
+ plat.provision_with "sudo dscl . -create /Users/test UniqueID 1001"
11
+ plat.provision_with "sudo dscl . -create /Users/test PrimaryGroupID 1000"
12
+ plat.provision_with "sudo dscl . -create /Users/test NFSHomeDirectory /Users/test"
13
+ plat.provision_with "sudo dscl . -passwd /Users/test password"
14
+ plat.provision_with "sudo dscl . -merge /Groups/admin GroupMembership test"
15
+ plat.provision_with "echo 'test ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/username"
16
+ plat.provision_with "mkdir -p /etc/homebrew"
17
+ plat.provision_with "cd /etc/homebrew"
18
+ plat.provision_with %Q(su test -c 'echo | /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"')
19
+ plat.provision_with "sudo chown -R test:admin /Users/test/"
20
+ plat.vmpooler_template "osx-1014-x86_64"
21
+ plat.output_dir File.join("apple", "10.14", "puppet6", "x86_64")
22
+ end
@@ -0,0 +1,21 @@
1
+ platform "osx-10.15-x86_64" do |plat|
2
+ plat.servicetype "launchd"
3
+ plat.servicedir "/Library/LaunchDaemons"
4
+ plat.codename "catalina"
5
+
6
+ plat.provision_with "export HOMEBREW_NO_EMOJI=true"
7
+ plat.provision_with "export HOMEBREW_VERBOSE=true"
8
+ plat.provision_with "sudo dscl . -create /Users/test"
9
+ plat.provision_with "sudo dscl . -create /Users/test UserShell /bin/bash"
10
+ plat.provision_with "sudo dscl . -create /Users/test UniqueID 1001"
11
+ plat.provision_with "sudo dscl . -create /Users/test PrimaryGroupID 1000"
12
+ plat.provision_with "sudo dscl . -create /Users/test NFSHomeDirectory /Users/test"
13
+ plat.provision_with "sudo dscl . -passwd /Users/test password"
14
+ plat.provision_with "sudo dscl . -merge /Groups/admin GroupMembership test"
15
+ plat.provision_with "echo 'test ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/username"
16
+ plat.provision_with "mkdir -p /etc/homebrew"
17
+ plat.provision_with "cd /etc/homebrew"
18
+ plat.provision_with %Q(su test -c 'echo | /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"')
19
+ plat.provision_with "sudo chown -R test:admin /Users/test/"
20
+ plat.vmpooler_template "osx-1015-x86_64"
21
+ end
@@ -0,0 +1,11 @@
1
+ platform "redhatfips-7-x86_64" do |plat|
2
+ plat.servicedir "/usr/lib/systemd/system"
3
+ plat.defaultdir "/etc/sysconfig"
4
+ plat.servicetype "systemd"
5
+
6
+ plat.add_build_repository "http://pl-build-tools.delivery.puppetlabs.net/yum/pl-build-tools-release-el-7.noarch.rpm"
7
+ packages = %w(autoconf automake createrepo rsync gcc make rpmdevtools rpm-libs yum-utils rpm-sign)
8
+ plat.provision_with "yum install --assumeyes #{packages.join(' ')}"
9
+ plat.install_build_dependencies_with "yum install --assumeyes"
10
+ plat.vmpooler_template "redhat-fips-7-x86_64"
11
+ end
@@ -0,0 +1,11 @@
1
+ platform "sles-12-x86_64" do |plat|
2
+ plat.servicedir "/usr/lib/systemd/system"
3
+ plat.defaultdir "/etc/sysconfig"
4
+ plat.servicetype "systemd"
5
+
6
+ plat.add_build_repository "http://pl-build-tools.delivery.puppetlabs.net/yum/pl-build-tools-release-#{plat.get_os_name}-#{plat.get_os_version}.noarch.rpm"
7
+ packages = %w(aaa_base autoconf automake rsync gcc make rpm-build)
8
+ plat.provision_with "zypper -n --no-gpg-checks install -y #{packages.join(' ')}"
9
+ plat.install_build_dependencies_with "zypper -n --no-gpg-checks install -y"
10
+ plat.vmpooler_template "sles-12-x86_64"
11
+ end
@@ -0,0 +1,10 @@
1
+ platform "sles-15-x86_64" do |plat|
2
+ plat.servicedir "/usr/lib/systemd/system"
3
+ plat.defaultdir "/etc/sysconfig"
4
+ plat.servicetype "systemd"
5
+
6
+ packages = %w(aaa_base autoconf automake rsync gcc gcc-c++ make rpm-build gettext-tools cmake)
7
+ plat.provision_with "zypper -n --no-gpg-checks install -y #{packages.join(' ')}"
8
+ plat.install_build_dependencies_with "zypper -n --no-gpg-checks install -y"
9
+ plat.vmpooler_template "sles-15-x86_64"
10
+ end
@@ -0,0 +1,9 @@
1
+ platform "solaris-11-i386" do |plat|
2
+ plat.servicedir "/lib/svc/manifest"
3
+ plat.defaultdir "/lib/svc/method"
4
+ plat.servicetype "smf"
5
+
6
+ plat.vmpooler_template "solaris-11-x86_64"
7
+ plat.add_build_repository "http://solaris-11-reposync.delivery.puppetlabs.net:81", "puppetlabs.com"
8
+ plat.install_build_dependencies_with "pkg install ", " || [[ $? -eq 4 ]]"
9
+ end
@@ -0,0 +1,10 @@
1
+ platform "solaris-11-sparc" do |plat|
2
+ plat.servicedir "/lib/svc/manifest"
3
+ plat.defaultdir "/lib/svc/method"
4
+ plat.servicetype "smf"
5
+
6
+ plat.cross_compiled true
7
+ plat.vmpooler_template "solaris-11-x86_64"
8
+ plat.add_build_repository "http://solaris-11-reposync.delivery.puppetlabs.net:81", "puppetlabs.com"
9
+ plat.install_build_dependencies_with "pkg install ", " || [[ $? -eq 4 ]]"
10
+ end
@@ -0,0 +1,12 @@
1
+ platform "ubuntu-16.04-amd64" do |plat|
2
+ plat.servicedir "/lib/systemd/system"
3
+ plat.defaultdir "/etc/default"
4
+ plat.servicetype "systemd"
5
+ plat.codename "xenial"
6
+
7
+ plat.add_build_repository "http://pl-build-tools.delivery.puppetlabs.net/debian/pl-build-tools-release-#{plat.get_codename}.deb"
8
+ packages = %w(build-essential devscripts make quilt pkg-config debhelper rsync fakeroot)
9
+ plat.provision_with "export DEBIAN_FRONTEND=noninteractive; apt-get update -qq; apt-get install -qy --no-install-recommends #{packages.join(' ')}"
10
+ plat.install_build_dependencies_with "DEBIAN_FRONTEND=noninteractive; apt-get install -qy --no-install-recommends "
11
+ plat.vmpooler_template "ubuntu-1604-x86_64"
12
+ end
@@ -0,0 +1,12 @@
1
+ platform "ubuntu-16.04-i386" do |plat|
2
+ plat.servicedir "/lib/systemd/system"
3
+ plat.defaultdir "/etc/default"
4
+ plat.servicetype "systemd"
5
+ plat.codename "xenial"
6
+
7
+ plat.add_build_repository "http://pl-build-tools.delivery.puppetlabs.net/debian/pl-build-tools-release-#{plat.get_codename}.deb"
8
+ packages = %w(build-essential devscripts make quilt pkg-config debhelper rsync fakeroot)
9
+ plat.provision_with "export DEBIAN_FRONTEND=noninteractive; apt-get update -qq; apt-get install -qy --no-install-recommends #{packages.join(' ')}"
10
+ plat.install_build_dependencies_with "DEBIAN_FRONTEND=noninteractive; apt-get install -qy --no-install-recommends "
11
+ plat.vmpooler_template "ubuntu-1604-i386"
12
+ end
@@ -0,0 +1,12 @@
1
+ platform "ubuntu-18.04-amd64" do |plat|
2
+ plat.servicedir "/lib/systemd/system"
3
+ plat.defaultdir "/etc/default"
4
+ plat.servicetype "systemd"
5
+ plat.codename "bionic"
6
+
7
+ plat.add_build_repository "http://pl-build-tools.delivery.puppetlabs.net/debian/pl-build-tools-release-#{plat.get_codename}.deb"
8
+ packages = %w(build-essential devscripts make quilt pkg-config debhelper rsync fakeroot)
9
+ plat.provision_with "export DEBIAN_FRONTEND=noninteractive; apt-get update -qq; apt-get install -qy --no-install-recommends #{packages.join(' ')}"
10
+ plat.install_build_dependencies_with "export DEBIAN_FRONTEND=noninteractive; apt-get install -qy --no-install-recommends "
11
+ plat.vmpooler_template "ubuntu-1804-x86_64"
12
+ end
@@ -0,0 +1,11 @@
1
+ platform "ubuntu-20.04-aarch64" do |plat|
2
+ plat.servicedir "/lib/systemd/system"
3
+ plat.defaultdir "/etc/default"
4
+ plat.servicetype "systemd"
5
+ plat.codename "focal"
6
+
7
+ packages = %w(build-essential devscripts make quilt pkg-config debhelper rsync fakeroot cmake)
8
+ plat.provision_with "export DEBIAN_FRONTEND=noninteractive; apt-get update -qq; apt-get install -qy --no-install-recommends #{packages.join(' ')}"
9
+ plat.install_build_dependencies_with "DEBIAN_FRONTEND=noninteractive; apt-get install -qy --no-install-recommends "
10
+ plat.vmpooler_template "ubuntu-2004-arm64"
11
+ end
@@ -0,0 +1,11 @@
1
+ platform "ubuntu-20.04-amd64" do |plat|
2
+ plat.servicedir "/lib/systemd/system"
3
+ plat.defaultdir "/etc/default"
4
+ plat.servicetype "systemd"
5
+ plat.codename "focal"
6
+
7
+ packages = %w(build-essential devscripts make quilt pkg-config debhelper rsync fakeroot cmake)
8
+ plat.provision_with "export DEBIAN_FRONTEND=noninteractive; apt-get update -qq; apt-get install -qy --no-install-recommends #{packages.join(' ')}"
9
+ plat.install_build_dependencies_with "DEBIAN_FRONTEND=noninteractive; apt-get install -qy --no-install-recommends "
10
+ plat.vmpooler_template "ubuntu-2004-x86_64"
11
+ end
@@ -85,6 +85,13 @@ class Vanagon
85
85
  method_name.to_s.start_with?('get_') || super
86
86
  end
87
87
 
88
+ def inherit_from_default(name = @name)
89
+ default_file = File.join(__dir__, 'defaults', "#{name}.rb")
90
+ default_object = Vanagon::Platform::DSL.new(name)
91
+
92
+ @platform = default_object.instance_eval(File.read(default_file), default_file, 1)
93
+ end
94
+
88
95
  # Adds an arbitrary environment variable to a Platform, which will be
89
96
  # merged with any environment variables defined by the Project into the
90
97
  # rendered Makefile
@@ -93,6 +93,7 @@ describe Vanagon::CLI::List do
93
93
  end
94
94
 
95
95
  describe "#run" do
96
+ let(:defaults){ ['def1', 'def2', 'def3'] }
96
97
  let(:projects){ ['foo', 'bar', 'baz'] }
97
98
  let(:platforms){ ['1', '2', '3'] }
98
99
  let(:output_both){
@@ -115,6 +116,9 @@ baz
115
116
  expect(Dir).to receive(:exist?)
116
117
  .with("#{File.join(Dir.pwd, 'configs', 'projects')}")
117
118
  .and_return(true)
119
+ expect(Dir).to receive(:children)
120
+ .with("#{File.join(Dir.pwd, 'lib', 'vanagon' ,'cli', '..', 'platform', 'defaults')}")
121
+ .and_return(defaults)
118
122
  expect(Dir).to receive(:children)
119
123
  .with("#{File.join(Dir.pwd, 'configs', 'projects')}")
120
124
  .and_return(projects)
@@ -124,28 +128,32 @@ baz
124
128
  end
125
129
  let(:options_empty) { {
126
130
  nil=>false,
127
- :configdir=>"#{Dir.pwd}/configs",
131
+ :configdir=>"#{Dir.pwd}/configs",
132
+ :defaults=>false,
128
133
  :platforms=>false,
129
134
  :projects=>false,
130
135
  :use_spaces=>false
131
136
  } }
132
137
  let(:options_platforms_only) { {
133
138
  nil=>false,
134
- :configdir=>"#{Dir.pwd}/configs",
139
+ :configdir=>"#{Dir.pwd}/configs",
140
+ :defaults=>false,
135
141
  :platforms=>true,
136
142
  :projects=>false,
137
143
  :use_spaces=>false
138
144
  } }
139
145
  let(:options_projects_only) { {
140
146
  nil=>false,
141
- :configdir=>"#{Dir.pwd}/configs",
147
+ :configdir=>"#{Dir.pwd}/configs",
148
+ :defaults=>false,
142
149
  :platforms=>false,
143
150
  :projects=>true,
144
151
  :use_spaces=>false
145
152
  } }
146
153
  let(:options_space_only) { {
147
154
  nil=>false,
148
- :configdir=>"#{Dir.pwd}/configs",
155
+ :configdir=>"#{Dir.pwd}/configs",
156
+ :defaults=>false,
149
157
  :platforms=>false,
150
158
  :projects=>false,
151
159
  :use_spaces=>true
@@ -202,14 +210,19 @@ baz
202
210
  let(:options_configdir) { {
203
211
  nil=>false,
204
212
  :configdir=> '/configs',
213
+ :defaults=>false,
205
214
  :platforms=>false,
206
215
  :projects=>false,
207
- :use_spaces=>false} }
216
+ :use_spaces=>false
217
+ } }
208
218
  it "it successfully takes the configs directory" do
209
219
  expect(Dir).to receive(:exist?).with('/configs' + '/platforms')
210
220
  .and_return(true)
211
221
  expect(Dir).to receive(:exist?).with('/configs' + '/projects')
212
222
  .and_return(true)
223
+ expect(Dir).to receive(:children)
224
+ .with("#{File.join(Dir.pwd, 'lib', 'vanagon' ,'cli', '..', 'platform', 'defaults')}")
225
+ .and_return(defaults)
213
226
  expect(Dir).to receive(:children).with('/configs' + '/projects')
214
227
  .and_return(projects)
215
228
  expect(Dir).to receive(:children).with('/configs' + '/platforms')
@@ -219,5 +232,43 @@ baz
219
232
  end.to output(output_both).to_stdout
220
233
  end
221
234
  end
235
+
236
+ context "spec to determine vanagon defaults" do
237
+ let(:options_default_platforms) { {
238
+ nil=>false,
239
+ :configdir=>"#{Dir.pwd}/configs",
240
+ :defaults=>true,
241
+ :platforms=>false,
242
+ :projects=>false,
243
+ :use_spaces=>false
244
+ } }
245
+ let(:output_defaults){
246
+ "- Defaults
247
+ def1
248
+ def2
249
+ def3
250
+ "
251
+ }
252
+ it "lists the vanagon defaults" do
253
+ expect(Dir).to receive(:exist?)
254
+ .with("#{File.join(Dir.pwd, 'configs', 'platforms')}")
255
+ .and_return(true)
256
+ expect(Dir).to receive(:exist?)
257
+ .with("#{File.join(Dir.pwd, 'configs', 'projects')}")
258
+ .and_return(true)
259
+ expect(Dir).to receive(:children)
260
+ .with("#{File.join(Dir.pwd, 'lib', 'vanagon' ,'cli', '..', 'platform', 'defaults')}")
261
+ .and_return(defaults)
262
+ expect(Dir).to receive(:children)
263
+ .with("#{File.join(Dir.pwd, 'configs', 'projects')}")
264
+ .and_return(projects)
265
+ expect(Dir).to receive(:children)
266
+ .with("#{File.join(Dir.pwd, 'configs', 'platforms')}")
267
+ .and_return(platforms)
268
+ expect do
269
+ cli.run(options_default_platforms)
270
+ end.to output(output_defaults).to_stdout
271
+ end
272
+ end
222
273
  end
223
274
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vanagon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.1
4
+ version: 0.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-16 00:00:00.000000000 Z
11
+ date: 2021-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt
@@ -152,6 +152,32 @@ files:
152
152
  - lib/vanagon/patch.rb
153
153
  - lib/vanagon/platform.rb
154
154
  - lib/vanagon/platform/deb.rb
155
+ - lib/vanagon/platform/defaults/debian-10-amd64.rb
156
+ - lib/vanagon/platform/defaults/debian-8-amd64.rb
157
+ - lib/vanagon/platform/defaults/debian-8-i386.rb
158
+ - lib/vanagon/platform/defaults/debian-9-amd64.rb
159
+ - lib/vanagon/platform/defaults/debian-9-i386.rb
160
+ - lib/vanagon/platform/defaults/el-6-i386.rb
161
+ - lib/vanagon/platform/defaults/el-6-x86_64.rb
162
+ - lib/vanagon/platform/defaults/el-7-aarch64.rb
163
+ - lib/vanagon/platform/defaults/el-7-x86_64.rb
164
+ - lib/vanagon/platform/defaults/el-8-aarch64.rb
165
+ - lib/vanagon/platform/defaults/el-8-x86_64.rb
166
+ - lib/vanagon/platform/defaults/fedora-30-x86_64.rb
167
+ - lib/vanagon/platform/defaults/fedora-31-x86_64.rb
168
+ - lib/vanagon/platform/defaults/fedora-32-x86_64.rb
169
+ - lib/vanagon/platform/defaults/osx-10.14-x86_64.rb
170
+ - lib/vanagon/platform/defaults/osx-10.15-x86_64.rb
171
+ - lib/vanagon/platform/defaults/redhatfips-7-x86_64.rb
172
+ - lib/vanagon/platform/defaults/sles-12-x86_64.rb
173
+ - lib/vanagon/platform/defaults/sles-15-x86_64.rb
174
+ - lib/vanagon/platform/defaults/solaris-11-i386.rb
175
+ - lib/vanagon/platform/defaults/solaris-11-sparc.rb
176
+ - lib/vanagon/platform/defaults/ubuntu-16.04-amd64.rb
177
+ - lib/vanagon/platform/defaults/ubuntu-16.04-i386.rb
178
+ - lib/vanagon/platform/defaults/ubuntu-18.04-amd64.rb
179
+ - lib/vanagon/platform/defaults/ubuntu-20.04-aarch64.rb
180
+ - lib/vanagon/platform/defaults/ubuntu-20.04-amd64.rb
155
181
  - lib/vanagon/platform/dsl.rb
156
182
  - lib/vanagon/platform/osx.rb
157
183
  - lib/vanagon/platform/rpm.rb
@@ -293,41 +319,41 @@ signing_key:
293
319
  specification_version: 3
294
320
  summary: All of your packages will fit into this van with this one simple trick.
295
321
  test_files:
296
- - spec/lib/vanagon/extensions/ostruct/json_spec.rb
297
- - spec/lib/vanagon/extensions/string_spec.rb
322
+ - spec/lib/git/rev_list_spec.rb
323
+ - spec/lib/makefile_spec.rb
324
+ - spec/lib/vanagon/common/user_spec.rb
325
+ - spec/lib/vanagon/common/pathname_spec.rb
298
326
  - spec/lib/vanagon/extensions/set/json_spec.rb
299
- - spec/lib/vanagon/platform/rpm_spec.rb
300
- - spec/lib/vanagon/platform/rpm/aix_spec.rb
301
- - spec/lib/vanagon/platform/windows_spec.rb
327
+ - spec/lib/vanagon/extensions/string_spec.rb
328
+ - spec/lib/vanagon/extensions/ostruct/json_spec.rb
329
+ - spec/lib/vanagon/component_spec.rb
330
+ - spec/lib/vanagon/utilities/shell_utilities_spec.rb
331
+ - spec/lib/vanagon/platform_spec.rb
332
+ - spec/lib/vanagon/environment_spec.rb
333
+ - spec/lib/vanagon/project/dsl_spec.rb
302
334
  - spec/lib/vanagon/platform/osx_spec.rb
303
- - spec/lib/vanagon/platform/solaris_10_spec.rb
304
335
  - spec/lib/vanagon/platform/dsl_spec.rb
305
- - spec/lib/vanagon/platform/deb_spec.rb
306
336
  - spec/lib/vanagon/platform/solaris_11_spec.rb
307
- - spec/lib/vanagon/project/dsl_spec.rb
308
- - spec/lib/vanagon/environment_spec.rb
309
- - spec/lib/vanagon/engine/ec2_spec.rb
310
- - spec/lib/vanagon/engine/local_spec.rb
311
- - spec/lib/vanagon/engine/docker_spec.rb
312
- - spec/lib/vanagon/engine/base_spec.rb
313
- - spec/lib/vanagon/engine/hardware_spec.rb
314
- - spec/lib/vanagon/engine/always_be_scheduling_spec.rb
315
- - spec/lib/vanagon/engine/pooler_spec.rb
316
- - spec/lib/vanagon/component_spec.rb
337
+ - spec/lib/vanagon/platform/rpm/aix_spec.rb
338
+ - spec/lib/vanagon/platform/windows_spec.rb
339
+ - spec/lib/vanagon/platform/deb_spec.rb
340
+ - spec/lib/vanagon/platform/rpm_spec.rb
341
+ - spec/lib/vanagon/platform/solaris_10_spec.rb
317
342
  - spec/lib/vanagon/component/rules_spec.rb
318
- - spec/lib/vanagon/component/source/http_spec.rb
319
- - spec/lib/vanagon/component/source/local_spec.rb
343
+ - spec/lib/vanagon/component/dsl_spec.rb
320
344
  - spec/lib/vanagon/component/source/rewrite_spec.rb
321
345
  - spec/lib/vanagon/component/source/git_spec.rb
322
- - spec/lib/vanagon/component/dsl_spec.rb
346
+ - spec/lib/vanagon/component/source/local_spec.rb
347
+ - spec/lib/vanagon/component/source/http_spec.rb
323
348
  - spec/lib/vanagon/component/source_spec.rb
324
- - spec/lib/vanagon/platform_spec.rb
325
- - spec/lib/vanagon/cli_spec.rb
326
- - spec/lib/vanagon/utilities_spec.rb
327
- - spec/lib/vanagon/common/user_spec.rb
328
- - spec/lib/vanagon/common/pathname_spec.rb
329
349
  - spec/lib/vanagon/driver_spec.rb
330
350
  - spec/lib/vanagon/project_spec.rb
331
- - spec/lib/vanagon/utilities/shell_utilities_spec.rb
332
- - spec/lib/makefile_spec.rb
333
- - spec/lib/git/rev_list_spec.rb
351
+ - spec/lib/vanagon/utilities_spec.rb
352
+ - spec/lib/vanagon/cli_spec.rb
353
+ - spec/lib/vanagon/engine/ec2_spec.rb
354
+ - spec/lib/vanagon/engine/always_be_scheduling_spec.rb
355
+ - spec/lib/vanagon/engine/base_spec.rb
356
+ - spec/lib/vanagon/engine/docker_spec.rb
357
+ - spec/lib/vanagon/engine/local_spec.rb
358
+ - spec/lib/vanagon/engine/hardware_spec.rb
359
+ - spec/lib/vanagon/engine/pooler_spec.rb