diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 929b45f5c..e953333b8 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,13 +1,13 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2021-11-08 09:10:03 UTC using RuboCop version 1.22.1. +# on 2022-07-01 09:39:49 UTC using RuboCop version 1.31.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. # Offense count: 2 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: aligned, indented Layout/LineEndStringConcatenationIndentation: @@ -24,7 +24,7 @@ Lint/DuplicateMethods: Metrics/AbcSize: Max: 45 -# Offense count: 25 +# Offense count: 26 # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods. # IgnoredMethods: refine Metrics/BlockLength: @@ -50,7 +50,7 @@ Naming/HeredocDelimiterNaming: - 'spec/travis_packer_templates_spec.rb' # Offense count: 10 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). Security/IoMethods: Exclude: - 'cookbooks/travis_ci_freebsd_12/metadata.rb' @@ -78,11 +78,27 @@ Style/AccessModifierDeclarations: - 'lib/stack_promotion_reporter.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). Style/CaseLikeIf: Exclude: - 'cookbooks/travis_ci_ubuntu_2004/attributes/default.rb' +# Offense count: 8 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowedVars. +Style/FetchEnvVar: + Exclude: + - 'bin/assert-job-board-tags' + - 'cookbooks/lib/features/jdk_spec.rb' + - 'cookbooks/lib/support.rb' + - 'cookbooks/lib/support/job_board_tags.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/MapToHash: + Exclude: + - 'spec/job_board_registrar_spec.rb' + # Offense count: 8 Style/MixinUsage: Exclude: @@ -95,23 +111,9 @@ Style/MixinUsage: - 'spec/image_metadata_spec.rb' - 'spec/travis_packer_templates_spec.rb' -# Offense count: 11 -# Cop supports --auto-correct. -Style/SelectByRegexp: - Exclude: - - 'cookbooks/lib/fake_attributes.rb' - - 'cookbooks/lib/support.rb' - - 'cookbooks/travis_ci_opal/attributes/default.rb' - - 'cookbooks/travis_ci_sardonyx/attributes/default.rb' - - 'cookbooks/travis_ci_ubuntu_1804/attributes/default.rb' - - 'cookbooks/travis_ci_ubuntu_1804_minimal/attributes/default.rb' - - 'cookbooks/travis_ci_ubuntu_2004/attributes/default.rb' - - 'cookbooks/travis_ci_ubuntu_2004_minimal/attributes/default.rb' - - 'cookbooks/travis_packer_templates/libraries/travis_packer_templates.rb' - # Offense count: 5 -# Cop supports --auto-correct. -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns. # URISchemes: http, https Layout/LineLength: Max: 169 diff --git a/.travis.yml b/.travis.yml index 1acc8a72e..000c3775b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ install: fi - export GIT_DESC="$(git describe --always --dirty --tags)" - rvm use 2.7.4 --install --binary --fuzzy -- gem install bundler:2.2.27 +- gem install bundler:2.3.16 - bundle install --jobs=3 --retry=2 --path=vendor/bundle - ./bin/packer-build-install - ln -sv "${TRAVIS_BUILD_DIR}" "${TRAVIS_BUILD_DIR}/tmp/packer-chef-local" diff --git a/Gemfile.lock b/Gemfile.lock index 7bf95fadb..79546f625 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,7 +10,7 @@ GIT GEM remote: https://rubygems.org/ specs: - activesupport (5.2.6) + activesupport (5.2.8) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -19,11 +19,11 @@ GEM public_suffix (>= 2.0.2, < 5.0) ast (2.4.2) coderay (1.1.3) - concurrent-ruby (1.1.9) - diff-lcs (1.4.4) + concurrent-ruby (1.1.10) + diff-lcs (1.5.0) docile (1.4.0) erubis (2.7.0) - faraday (0.17.4) + faraday (0.17.5) multipart-post (>= 1.2, < 3) faraday_middleware (0.14.0) faraday (>= 0.7.4, < 1.0) @@ -44,59 +44,59 @@ GEM multi_json (~> 1.0) net-http-persistent (~> 2.9) net-http-pipeline - git (1.9.1) + git (1.11.0) rchardet (~> 1.8) - i18n (1.8.10) + i18n (1.10.0) concurrent-ruby (~> 1.0) libyajl2 (2.1.0) method_source (1.0.0) - mini_portile2 (2.6.1) - minitest (5.14.4) + mini_portile2 (2.8.0) + minitest (5.16.1) multi_json (1.15.0) - multipart-post (2.1.1) + multipart-post (2.2.3) net-http-persistent (2.9.4) net-http-pipeline (1.0.1) - nokogiri (1.12.5) - mini_portile2 (~> 2.6.1) + nokogiri (1.13.6) + mini_portile2 (~> 2.8.0) racc (~> 1.4) - parallel (1.21.0) - parser (3.0.2.0) + parallel (1.22.1) + parser (3.1.2.0) ast (~> 2.4.1) polyglot (0.3.5) pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (4.0.6) + public_suffix (4.0.7) racc (1.6.0) - rainbow (3.0.0) + rainbow (3.1.1) rake (13.0.6) rchardet (1.8.0) - regexp_parser (2.1.1) + regexp_parser (2.5.0) rexml (3.2.5) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.1) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.1) + rspec (3.11.0) + rspec-core (~> 3.11.0) + rspec-expectations (~> 3.11.0) + rspec-mocks (~> 3.11.0) + rspec-core (3.11.0) + rspec-support (~> 3.11.0) + rspec-expectations (3.11.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-mocks (3.10.2) + rspec-support (~> 3.11.0) + rspec-mocks (3.11.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-support (3.10.2) - rubocop (1.22.3) + rspec-support (~> 3.11.0) + rspec-support (3.11.0) + rubocop (1.31.0) parallel (~> 1.10) - parser (>= 3.0.0.0) + parser (>= 3.1.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.12.0, < 2.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.18.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.12.0) - parser (>= 3.0.1.1) + rubocop-ast (1.18.0) + parser (>= 3.1.1.0) ruby-progressbar (1.11.0) rufus-lru (1.1.0) simplecov (0.21.2) @@ -104,13 +104,13 @@ GEM simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) - simplecov_json_formatter (0.1.3) + simplecov_json_formatter (0.1.4) thread_safe (0.3.6) treetop (1.6.11) polyglot (~> 0.3) tzinfo (1.2.9) thread_safe (~> 0.1) - unicode-display_width (2.1.0) + unicode-display_width (2.2.0) PLATFORMS ruby @@ -124,4 +124,4 @@ DEPENDENCIES travis-packer-build! BUNDLED WITH - 2.1.4 + 2.3.16 diff --git a/ci-opal.yml b/ci-opal.yml index 111bed4f1..f472e8d50 100644 --- a/ci-opal.yml +++ b/ci-opal.yml @@ -159,7 +159,7 @@ provisioners: - type: shell inline: chmod 0644 /var/tmp/opal-system-info-commands.yml - type: chef-solo - version: 17.6.18 + version: 17.10.3 config_template: chef-solo.rb.tmpl <% if ENV['CHEF_PROFILING'] %> execute_command: "{{if .Sudo}}sudo {{end}}CI=yes chef-solo --chef-license accept-silent -F doc --no-color -c {{.ConfigPath}} -j {{.JsonPath}}" @@ -192,6 +192,8 @@ provisioners: - packer-scripts/purge - packer-scripts/disable-apparmor - packer-scripts/run-serverspecs + - packer-scripts/perforce-install + - packer-scripts/cosign-install - packer-scripts/test-system-info-output - packer-scripts/dump-dpkg-manifest - packer-scripts/create-bin-lib-checksums diff --git a/ci-rhel-8.yml b/ci-rhel-8.yml new file mode 100644 index 000000000..0cb8c5bb5 --- /dev/null +++ b/ci-rhel-8.yml @@ -0,0 +1,89 @@ +--- +description: Travis CI Red Hat Universal Base Image 8 build env template +variables: + chef_log_level: info + docker_repository: travisci/ci-rhel-8 + docker_tag: packer-{{ timestamp }}-<%= git_desc %> + gce_account_file: "{{ env `GCE_ACCOUNT_FILE` }}" + gce_project_id: "{{ env `GCE_PROJECT_ID` }}" + image_name: travis-ci-rhel-8-{{ timestamp }}-<%= git_desc %> + travis_cookbooks_branch: "{{ env `TRAVIS_COOKBOOKS_BRANCH` }}" + travis_cookbooks_edge_branch: master + travis_cookbooks_sha: "{{ env `TRAVIS_COOKBOOKS_SHA` }}" + travis_uid: "{{ env `TRAVIS_UID` }}" + travis_subnet_id: "{{ env `TRAVIS_SUBNET_ID` }}" + travis_vpc_id: "{{ env `TRAVIS_VPC_ID` }}" + travis_source_ami: "{{ env `TRAVIS_SOURCE_AMI` }}" +builders: +- type: docker + name: docker + ssh_pty: true + image: "redhat/ubi8" + run_command: + - -d + - -v + - <%= Dir.pwd %>/tmp/packer-builder-tmp:/tmp + - --privileged=true + # Disable on bionic, it's only supported overlay fs on xfs with quota + # - --storage-opt=size=11G + - "{{ .Image }}" + - /sbin/init + commit: true +provisioners: +- type: shell + scripts: + - packer-scripts/pre-chef-bootstrap-rhel + environment_vars: + - TRAVIS_UID={{ user `travis_uid` }} + execute_command: "{{ .Vars }} exec bash '{{ .Path }}'" +- type: shell + scripts: + - packer-scripts/rhel8-install-pkgs + environment_vars: + - TRAVIS_UID={{ user `travis_uid` }} + execute_command: "{{ .Vars }} exec sudo -u travis -E -S bash '{{ .Path }}'" +- type: shell + scripts: + - packer-scripts/cosign-install + environment_vars: + - TRAVIS_UID={{ user `travis_uid` }} + execute_command: "{{ .Vars }} exec sudo -E -S bash '{{ .Path }}'" +- type: shell + scripts: + - packer-scripts/packer-env-dump + execute_command: "{{ .Vars }} exec sudo -E -S bash '{{ .Path }}'" +- type: shell + scripts: + - packer-scripts/create-rhel8-job-board-data + - packer-scripts/create-image-metadata-tarball-bsd + environment_vars: + - JOB_BOARD_REGISTER_FILE=/.job_board_register.yml + - IMAGE_METADATA_TARBALL=/var/tmp/image-metadata-{{ user `image_name` }}.tar.bz2 + execute_command: "{{ .Vars }} exec sudo -E -S bash '{{ .Path }}'" +- type: file + source: /var/tmp/image-metadata-{{ user `image_name` }}.tar.bz2 + destination: tmp/image-metadata-{{ user `image_name` }}.tar.bz2 + direction: download +post-processors: +- + - type: docker-tag + repository: "{{ user `docker_repository` }}" + tag: "{{ user `docker_tag` }}" + only: + - docker + - type: shell-local + scripts: bin/docker-push + environment_vars: + - DOCKER_DEST={{ user `docker_repository` }}:{{ user `docker_tag` }} + only: + - docker +#- +# - type: shell-local +# script: bin/job-board-register +# environment_vars: +# - IMAGE_NAME={{ user `docker_repository` }}:{{ user `docker_tag` }} +# only: +# - docker +- + - type: shell-local + script: bin/write-latest-image-name diff --git a/ci-sardonyx.yml b/ci-sardonyx.yml index 6bc0e08e4..0bea83fdf 100644 --- a/ci-sardonyx.yml +++ b/ci-sardonyx.yml @@ -69,7 +69,7 @@ builders: # https://github.com/travis-ci/packer-templates/issues/555 - type: openstack name: openstack - flavor: m1.large + flavor: p9.large insecure: true image_name: "{{ user `image_name` }}" ssh_username: ubuntu @@ -160,7 +160,7 @@ provisioners: - type: shell inline: chmod 0644 /var/tmp/sardonyx-system-info-commands.yml - type: chef-solo - version: 17.6.18 + version: 17.10.3 config_template: chef-solo.rb.tmpl <% if ENV['CHEF_PROFILING'] %> execute_command: "{{if .Sudo}}sudo {{end}}CI=yes chef-solo --chef-license accept-silent -F doc --no-color -c {{.ConfigPath}} -j {{.JsonPath}}" @@ -193,6 +193,8 @@ provisioners: - packer-scripts/purge - packer-scripts/disable-apparmor - packer-scripts/run-serverspecs + - packer-scripts/perforce-install + - packer-scripts/cosign-install - packer-scripts/test-system-info-output - packer-scripts/dump-dpkg-manifest - packer-scripts/create-bin-lib-checksums diff --git a/ci-stevonnie.yml b/ci-stevonnie.yml index 8f4ac7f80..ba88a3ca3 100644 --- a/ci-stevonnie.yml +++ b/ci-stevonnie.yml @@ -160,7 +160,7 @@ provisioners: - type: shell inline: chmod 0644 /var/tmp/stevonnie-system-info-commands.yml - type: chef-solo - version: 17.6.18 + version: 17.10.3 config_template: chef-solo.rb.tmpl <% if ENV['CHEF_PROFILING'] %> execute_command: "{{if .Sudo}}sudo {{end}}CI=yes chef-solo --chef-license accept-silent -F doc --no-color -c {{.ConfigPath}} -j {{.JsonPath}}" @@ -193,6 +193,8 @@ provisioners: - packer-scripts/purge - packer-scripts/disable-apparmor - packer-scripts/run-serverspecs + - packer-scripts/perforce-install + - packer-scripts/cosign-install - packer-scripts/test-system-info-output - packer-scripts/dump-dpkg-manifest - packer-scripts/create-bin-lib-checksums diff --git a/ci-ubuntu-1804-minimal.yml b/ci-ubuntu-1804-minimal.yml index f3ca23645..341337d7f 100644 --- a/ci-ubuntu-1804-minimal.yml +++ b/ci-ubuntu-1804-minimal.yml @@ -138,7 +138,7 @@ provisioners: - type: shell inline: chmod 0644 /var/tmp/ubuntu-1804-minimal-system-info-commands.yml - type: chef-solo - version: 17.6.18 + version: 17.10.3 config_template: chef-solo.rb.tmpl <% if ENV['CHEF_PROFILING'] %> execute_command: "{{if .Sudo}}sudo {{end}}CI=yes chef-solo --chef-license accept-silent -F doc --no-color -c {{.ConfigPath}} -j {{.JsonPath}}" diff --git a/ci-ubuntu-1804.yml b/ci-ubuntu-1804.yml index 010cb79ed..4e9e98726 100644 --- a/ci-ubuntu-1804.yml +++ b/ci-ubuntu-1804.yml @@ -124,6 +124,10 @@ provisioners: only: - lxd # end Recommendations +- type: shell + scripts: + - packer-scripts/couchdb_pre_config # couchdb template for version 3.2.2 + execute_command: "{{ .Vars }} exec sudo -E -S bash '{{ .Path }}'" - type: shell scripts: - packer-scripts/pre-chef-bootstrap @@ -140,7 +144,7 @@ provisioners: - type: shell inline: chmod 0644 /var/tmp/ubuntu-1804-system-info-commands.yml - type: chef-solo - version: 17.6.18 + version: 17.10.3 config_template: chef-solo.rb.tmpl <% if ENV['CHEF_PROFILING'] %> execute_command: "{{if .Sudo}}sudo {{end}}CI=yes chef-solo --chef-license accept-silent -F doc --no-color -c {{.ConfigPath}} -j {{.JsonPath}}" @@ -173,6 +177,8 @@ provisioners: - packer-scripts/purge - packer-scripts/disable-apparmor - packer-scripts/run-serverspecs + - packer-scripts/perforce-install + - packer-scripts/cosign-install - packer-scripts/test-system-info-output - packer-scripts/dump-dpkg-manifest - packer-scripts/create-bin-lib-checksums @@ -194,7 +200,7 @@ provisioners: # # - "rm -v /etc/systemd/system/network-online.target.wants/networking.service" # # - "rm -v /etc/systemd/system/multi-user.target.wants/networking.service" - type: shell - inline: "sudo chown -R couchdb:couchdb /opt/couchdb/" + inline: "sudo chown -R couchdb:couchdb /opt/couchdb/" - type: shell inline: "ls -lah /opt/couchdb/" - type: shell diff --git a/ci-ubuntu-2004-minimal.yml b/ci-ubuntu-2004-minimal.yml index 15df20438..0ad8d0c49 100644 --- a/ci-ubuntu-2004-minimal.yml +++ b/ci-ubuntu-2004-minimal.yml @@ -139,7 +139,7 @@ provisioners: - type: shell inline: chmod 0644 /var/tmp/ubuntu-2004-minimal-system-info-commands.yml - type: chef-solo - version: 17.6.18 + version: 17.10.3 config_template: chef-solo.rb.tmpl <% if ENV['CHEF_PROFILING'] %> execute_command: "{{if .Sudo}}sudo {{end}}CI=yes chef-solo --chef-license accept-silent -F doc --no-color -c {{.ConfigPath}} -j {{.JsonPath}}" diff --git a/ci-ubuntu-2004.yml b/ci-ubuntu-2004.yml index 4c5531a19..3e4b71740 100644 --- a/ci-ubuntu-2004.yml +++ b/ci-ubuntu-2004.yml @@ -42,7 +42,7 @@ builders: image_description: Travis CI Ubuntu 20.04 account_file: "{{ user `gce_account_file` }}" project_id: "{{ user `gce_project_id` }}" - source_image: ubuntu-2004-focal-v20200423 + source_image_family: ubuntu-2004-lts image_licenses: ["projects/vm-options/global/licenses/enable-vmx"] zone: us-central1-a image_name: "{{ user `image_name` }}" @@ -148,6 +148,10 @@ provisioners: only: - lxd # end Recommendations +- type: shell + scripts: + - packer-scripts/couchdb_pre_config # couchdb template for version 3.2.2 + execute_command: "{{ .Vars }} exec sudo -E -S bash '{{ .Path }}'" - type: shell scripts: - packer-scripts/pre-chef-bootstrap-focal @@ -164,7 +168,7 @@ provisioners: - type: shell inline: chmod 0644 /var/tmp/ubuntu-2004-system-info-commands.yml - type: chef-solo - version: 17.6.18 + version: 17.10.3 config_template: chef-solo.rb.tmpl <% if ENV['CHEF_PROFILING'] %> execute_command: "{{if .Sudo}}sudo {{end}}CI=yes chef-solo --chef-license accept-silent -F doc --no-color -c {{.ConfigPath}} -j {{.JsonPath}}" @@ -197,6 +201,8 @@ provisioners: - packer-scripts/purge - packer-scripts/disable-apparmor - packer-scripts/run-serverspecs + - packer-scripts/perforce-install + - packer-scripts/cosign-install - packer-scripts/test-system-info-output - packer-scripts/dump-dpkg-manifest - packer-scripts/create-bin-lib-checksums @@ -218,7 +224,7 @@ provisioners: # # - "rm -v /etc/systemd/system/network-online.target.wants/networking.service" # # - "rm -v /etc/systemd/system/multi-user.target.wants/networking.service" - type: shell - inline: "sudo chown -R couchdb:couchdb /opt/couchdb/" + inline: "sudo chown -R couchdb:couchdb /opt/couchdb/" - type: shell inline: "ls -lah /opt/couchdb/" - type: shell diff --git a/cookbooks/lib/languages/python_spec.rb b/cookbooks/lib/languages/python_spec.rb index f4bb2d403..0f34b7240 100644 --- a/cookbooks/lib/languages/python_spec.rb +++ b/cookbooks/lib/languages/python_spec.rb @@ -6,9 +6,11 @@ require 'features/pyenv_spec' describe 'python environment' do - describe pycommand('easy_install --version') do - its(:stderr) { should be_empty } - its(:stdout) { should match(/^setuptools \d+\.\d+\.\d+/) } + if %w[xenial bionic].include?(Support.distro) # issue with system python3.8 for Focal dist + describe pycommand('easy_install --version') do + its(:stderr) { should be_empty } + its(:stdout) { should match(/^setuptools \d+\.\d+\.\d+/) } + end end describe pycommand('pip --version') do @@ -21,9 +23,16 @@ its(:stdout) { should match(/^wheel \d+\.\d+\.\d+/) } end - describe pycommand('py.test --version') do - its(:stdout) { should be_empty } - its(:stderr) { should match(/pytest (version )?\d+\.\d+\.\d+/) } + if %w[xenial bionic].include?(Support.distro) + describe pycommand('py.test --version') do + its(:stdout) { should be_empty } + its(:stderr) { should match(/pytest version \d+\.\d+\.\d+/) } + end + elsif 'focal'.include?(Support.distro) + describe pycommand('py.test --version') do + its(:stderr) { should be_empty } + its(:stdout) { should match(/pytest (version )?\d+\.\d+\.\d+/) } + end end describe pycommand('nosetests --version') do @@ -46,15 +55,16 @@ } elsif 'bionic'.include?(Support.distro) vers = { - 'python2.7' => '2.7.17', - 'python3.6' => '3.6.10', - 'python3.7' => '3.7.6', - 'python3.8' => '3.8.1' + 'python2.7' => '2.7.18', + 'python3.6' => '3.6.15', + 'python3.7' => '3.7.13', + 'python3.8' => '3.8.13' } elsif 'focal'.include?(Support.distro) vers = { - 'python3.7' => '3.7.7', - 'python3.8' => '3.8.3' + 'python3.7' => '3.7.13', + 'python3.8' => '3.8.13', + 'python3.9' => '3.9.0' } end diff --git a/cookbooks/travis_ci_freebsd_12/recipes/jdk_switcher.rb b/cookbooks/travis_ci_freebsd_12/recipes/jdk_switcher.rb index a560c2c52..595372e24 100644 --- a/cookbooks/travis_ci_freebsd_12/recipes/jdk_switcher.rb +++ b/cookbooks/travis_ci_freebsd_12/recipes/jdk_switcher.rb @@ -40,7 +40,7 @@ ) end -ENV['PATH'] = "#{jdk_switcher_dir}:#{ENV['PATH']}" +ENV['PATH'] = "#{jdk_switcher_dir}:#{ENV.fetch('PATH', nil)}" bash 'source_jdk_switcher_in_bash_profile' do code "echo 'source #{jdk_switcher_source_path}' >> #{node['travis_build_environment']['home']}/.bash_profile" user node['travis_build_environment']['user'] diff --git a/cookbooks/travis_ci_freebsd_12/recipes/pyenv.rb b/cookbooks/travis_ci_freebsd_12/recipes/pyenv.rb index 4900d620f..f61665e3e 100644 --- a/cookbooks/travis_ci_freebsd_12/recipes/pyenv.rb +++ b/cookbooks/travis_ci_freebsd_12/recipes/pyenv.rb @@ -61,7 +61,7 @@ group node['travis_build_environment']['group'] environment( 'HOME' => node['travis_build_environment']['home'], - 'PATH' => ENV['PATH'] + 'PATH' => ENV.fetch('PATH', nil) ) end @@ -78,7 +78,7 @@ group node['travis_build_environment']['group'] environment( 'HOME' => node['travis_build_environment']['home'], - 'PATH' => ENV['PATH'] + 'PATH' => ENV.fetch('PATH', nil) ) end end @@ -92,7 +92,7 @@ group node['travis_build_environment']['group'] environment( 'HOME' => node['travis_build_environment']['home'], - 'PATH' => ENV['PATH'] + 'PATH' => ENV.fetch('PATH', nil) ) end @@ -102,6 +102,6 @@ group node['travis_build_environment']['group'] environment( 'HOME' => node['travis_build_environment']['home'], - 'PATH' => ENV['PATH'] + 'PATH' => ENV.fetch('PATH', nil) ) end diff --git a/cookbooks/travis_ci_opal/attributes/default.rb b/cookbooks/travis_ci_opal/attributes/default.rb index 8b9a2d159..80ad68761 100644 --- a/cookbooks/travis_ci_opal/attributes/default.rb +++ b/cookbooks/travis_ci_opal/attributes/default.rb @@ -12,9 +12,9 @@ '/var/tmp/opal-system-info-commands.yml' override['travis_perlbrew']['perls'] = [ - { name: '5.26', version: 'perl-5.26.2' }, - { name: '5.26-extras', version: 'perl-5.26.2', - arguments: '-Duseshrplib -Duseithreads', alias: '5.26-shrplib' }, + { name: '5.28', version: 'perl-5.28.2' }, + { name: '5.28-extras', version: 'perl-5.28.2', + arguments: '-Duseshrplib -Duseithreads', alias: '5.28-shrplib' }, { name: '5.24', version: 'perl-5.24.0' }, { name: '5.24-extras', version: 'perl-5.24.0', arguments: '-Duseshrplib -Duseithreads', alias: '5.24-shrplib' } @@ -106,7 +106,7 @@ def python_aliases(full_name) override['travis_build_environment']['rubies'] = rubies override['travis_build_environment']['otp_releases'] = %w[ - 21.1 + 25.0.2 ] elixirs = %w[ 1.7.4 diff --git a/cookbooks/travis_ci_rhel_8/.rspec b/cookbooks/travis_ci_rhel_8/.rspec new file mode 100644 index 000000000..d8e1838e0 --- /dev/null +++ b/cookbooks/travis_ci_rhel_8/.rspec @@ -0,0 +1,4 @@ +--color +--format documentation +--require support +--order rand diff --git a/cookbooks/travis_ci_rhel_8/README.md b/cookbooks/travis_ci_rhel_8/README.md new file mode 100644 index 000000000..484b674c2 --- /dev/null +++ b/cookbooks/travis_ci_rhel_8/README.md @@ -0,0 +1,4 @@ +travis_ci_rhel_8 Cookbook +========================= + +A wrapper cookbook for the "rhel_8" CI image. diff --git a/cookbooks/travis_ci_rhel_8/attributes/default.rb b/cookbooks/travis_ci_rhel_8/attributes/default.rb new file mode 100644 index 000000000..58ea928e7 --- /dev/null +++ b/cookbooks/travis_ci_rhel_8/attributes/default.rb @@ -0,0 +1,179 @@ +# frozen_string_literal: true + +override['maven']['install_java'] = false +override['travis_system_info']['commands_file'] = \ + '/var/tmp/rhel-8-system-info-commands.yml' +override['travis_build_environment']['system_python']['pythons'] = %w[3.8] +override['travis_build_environment']['python_aliases'] = { + '3.8.3' => %w[3.8], + '3.7.7' => %w[3.7], + 'pypy2.7-7.3.1' => %w[pypy], + 'pypy3.6-7.3.1' => %w[pypy3] +} +# packages build by Cpython + our repo +pythons = %w[ + 3.7.7 + 3.8.3 +] +override['travis_build_environment']['pythons'] = pythons +override['travis_build_environment']['virtualenv']['version'] = '20.0.20' + +override['travis_build_environment']['pip']['packages'] = {} # need to fill in + +# our php builder +php_aliases = { + '7.4' => '7.4.6' +} +override['travis_build_environment']['php_versions'] = php_aliases.values +override['travis_build_environment']['php_default_version'] = php_aliases['7.4'] +override['travis_build_environment']['php_aliases'] = php_aliases + +override['travis_perlbrew']['perls'] = [{ name: '5.32.0', version: 'perl-5.32.0' }, { name: '5.33.0', version: 'perl-5.33.0' }] +override['travis_perlbrew']['prerequisite_packages'] = [] + +gimme_versions = %w[ + 1.11.1 +] + +override['travis_build_environment']['gimme']['versions'] = gimme_versions +override['travis_build_environment']['gimme']['default_version'] = gimme_versions.max + +override['travis_jdk']['versions'] = %w[ + openjdk10 + openjdk11 +] +override['travis_jdk']['default'] = 'openjdk11' + +override['leiningen']['home'] = '/home/travis' +override['leiningen']['user'] = 'travis' + +override['travis_build_environment']['cmake']['version'] = '3.16.8' +override['travis_build_environment']['cmake']['checksum'] = '6b5c856158c16307692ae54ba761cfe30df7b2a131d602e83fda42a572973063' +override['travis_build_environment']['cmake']['download_url'] = ::File.join( + 'https://cmake.org/files', + "v#{node['travis_build_environment']['cmake']['version'].split('.')[0, 2].join('.')}", + "cmake-#{node['travis_build_environment']['cmake']['version']}-Linux-x86_64.tar.gz" +) + +override['travis_build_environment']['nodejs_versions'] = %w[ + 12.7.0 + 10.16.0 +] +override['travis_build_environment']['nodejs_default'] = '10.16.0' + +rubies = %w[ + 2.5.7 + 2.5.8 + 2.6.5 + 2.6.6 + 2.7.0 + 2.7.1 +] + +override['travis_build_environment']['default_ruby'] = rubies.reject { |n| n =~ /jruby/ }.max +override['travis_build_environment']['rubies'] = rubies + +override['travis_build_environment']['otp_releases'] = %w[ + 21.1 +] +elixirs = %w[ + 1.7.4 +] +override['travis_build_environment']['elixir_versions'] = elixirs +override['travis_build_environment']['default_elixir_version'] = elixirs.max + +override['travis_build_environment']['update_hostname'] = false +override['travis_build_environment']['update_hostname'] = true if node['kernel']['machine'] == 'ppc64le' +override['travis_build_environment']['use_tmpfs_for_builds'] = false + +override['travis_build_environment']['mercurial_install_type'] = 'pip' +override['travis_build_environment']['mercurial_version'] = '5.3' +override['travis_build_environment']['ibm_advanced_tool_chain_version'] = 14.0 + +override['travis_packer_templates']['job_board']['stack'] = 'rhel_8' + +# not yet supported +override['travis_postgresql']['default_version'] = '12' +override['travis_postgresql']['alternate_versions'] = %w[] +override['travis_postgresql']['enabled'] = false # is default instance started on machine boot? + +override['travis_packer_templates']['job_board']['features'] = %w[ + #basic + #couchdb + #disabled-ipv6 + #docker + #docker-compose + #elasticsearch + #firefox + #go-toolchain + #google-chrome + #jdk + #memcached + #mongodb + #mysql + nodejs_interpreter + perl_interpreter + #perlbrew + #phantomjs + postgresql + #python_interpreter + #redis + ruby_interpreter + #sqlite + #xserver +] +override['travis_packer_templates']['job_board']['languages'] = %w[ + __rhel_8__ + c + c++ + clojure + cplusplus + cpp + default + generic + go + groovy + java + node_js + php + pure_java + python + ruby + scala + julia + erlang +] + +# Override values in array : minimal set of options +override['travis_packer_templates']['job_board']['features'] = %w[ + generic + basic + ruby_interpreter +] +# Set minimal languages +override['travis_packer_templates']['job_board']['languages'] = %w[ + __rhel_8__ + c + c++ + cplusplus + cpp + ruby + python + go + java + php + node_js + smalltalk + csharp + perl + rust + elixir + erlang +] + +override['travis_docker']['version'] = '20.10.7' +override['travis_docker']['binary']['version'] = '20.10.7' +override['travis_docker']['compose']['url'] = 'https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64' +override['travis_docker']['compose']['sha256sum'] = 'f3f10cf3dbb8107e9ba2ea5f23c1d2159ff7321d16f0a23051d68d8e2547b323' +override['travis_docker']['binary']['url'] = 'https://download.docker.com/linux/static/stable/x86_64/docker-20.10.7.tgz' +override['travis_docker']['binary']['checksum'] = '34ad50146fce29b28e5115a1e8510dd5232459c9a4a9f28f65909f92cca314d9' diff --git a/cookbooks/travis_ci_rhel_8/metadata.rb b/cookbooks/travis_ci_rhel_8/metadata.rb new file mode 100644 index 000000000..9cef0b9d5 --- /dev/null +++ b/cookbooks/travis_ci_rhel_8/metadata.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +name 'travis_ci_rhel_8' +maintainer 'Travis CI GmbH' +maintainer_email 'contact+packer-templates@travis-ci.org' +license 'MIT' +description 'Installs/Configures travis_ci_rhel_8' +long_description '' +version '0.1.0' +source_url 'https://github.com/travis-ci/packer-templates' +issues_url 'https://github.com/travis-ci/packer-templates/issues' + +depends 'memcached' +depends 'openssl' +depends 'travis_build_environment' +depends 'travis_docker' +depends 'travis_java' +depends 'travis_jdk' +depends 'travis_packer_templates' +depends 'travis_perlbrew' +depends 'travis_phantomjs' +depends 'travis_postgresql' +depends 'travis_sbt_extras' +depends 'travis_system_info' diff --git a/cookbooks/travis_ci_rhel_8/recipes/mysql.rb b/cookbooks/travis_ci_rhel_8/recipes/mysql.rb new file mode 100644 index 000000000..f92cd296f --- /dev/null +++ b/cookbooks/travis_ci_rhel_8/recipes/mysql.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +package 'mysql-server' +package 'mysql-client' + +template "#{node['travis_build_environment']['home']}/.my.cnf" do + source 'ci_user/dot_my.cnf.erb' + user node['travis_build_environment']['user'] + group node['travis_build_environment']['group'] + mode 0o640 + variables(socket: node['travis_build_environment']['mysql']['socket']) +end + +bash 'config_mysql' do + code <<-E0H + mysql -u root -e "CREATE USER 'travis'@'%' IDENTIFIED BY ''" + mysql -u root -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('')" + mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'travis'@'%'" + mysql -u root -e "CREATE USER 'travis'@'localhost' IDENTIFIED BY ''" + mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'travis'@'localhost'" + mysql -u root -e "CREATE USER 'travis'@'127.0.0.1' IDENTIFIED BY ''" + mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'travis'@'127.0.0.1'" + mysql -u root -e "UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE User = 'root'; FLUSH PRIVILEGES;" + E0H +end + +include_recipe 'travis_build_environment::bash_profile_d' + +file ::File.join( + node['travis_build_environment']['home'], + '.bash_profile.d/travis-mysql.bash' +) do + content "export MYSQL_UNIX_PORT=#{node['travis_build_environment']['mysql']['socket']}\n" + owner node['travis_build_environment']['user'] + group node['travis_build_environment']['group'] + mode 0o644 +end + +service 'mysql' do + action [:disable, :stop] +end diff --git a/cookbooks/travis_ci_rhel_8/templates/default/ci_user/dot_my.cnf.erb b/cookbooks/travis_ci_rhel_8/templates/default/ci_user/dot_my.cnf.erb new file mode 100644 index 000000000..dfbf40bf9 --- /dev/null +++ b/cookbooks/travis_ci_rhel_8/templates/default/ci_user/dot_my.cnf.erb @@ -0,0 +1,11 @@ +# Managed by Chef for <%= node.name %> :heart_eyes_cat: + +[client] +default-character-set = utf8 +port = 3306 +user = root +password = +socket = <%= @socket %> + +[mysql] +default-character-set = utf8 diff --git a/cookbooks/travis_ci_rhel_8/templates/default/pg_hba.conf.erb b/cookbooks/travis_ci_rhel_8/templates/default/pg_hba.conf.erb new file mode 100644 index 000000000..328c8abfd --- /dev/null +++ b/cookbooks/travis_ci_rhel_8/templates/default/pg_hba.conf.erb @@ -0,0 +1,103 @@ +# PostgreSQL Client Authentication Configuration File +# =================================================== +# +# Refer to the "Client Authentication" section in the PostgreSQL +# documentation for a complete description of this file. A short +# synopsis follows. +# +# This file controls: which hosts are allowed to connect, how clients +# are authenticated, which PostgreSQL user names they can use, which +# databases they can access. Records take one of these forms: +# +# local DATABASE USER METHOD [OPTIONS] +# host DATABASE USER ADDRESS METHOD [OPTIONS] +# hostssl DATABASE USER ADDRESS METHOD [OPTIONS] +# hostnossl DATABASE USER ADDRESS METHOD [OPTIONS] +# hostgssenc DATABASE USER ADDRESS METHOD [OPTIONS] +# hostnogssenc DATABASE USER ADDRESS METHOD [OPTIONS] +# +# (The uppercase items must be replaced by actual values.) +# +# The first field is the connection type: "local" is a Unix-domain +# socket, "host" is either a plain or SSL-encrypted TCP/IP socket, +# "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a +# non-SSL TCP/IP socket. Similarly, "hostgssenc" uses a +# GSSAPI-encrypted TCP/IP socket, while "hostnogssenc" uses a +# non-GSSAPI socket. +# +# DATABASE can be "all", "sameuser", "samerole", "replication", a +# database name, or a comma-separated list thereof. The "all" +# keyword does not match "replication". Access to replication +# must be enabled in a separate record (see example below). +# +# USER can be "all", a user name, a group name prefixed with "+", or a +# comma-separated list thereof. In both the DATABASE and USER fields +# you can also write a file name prefixed with "@" to include names +# from a separate file. +# +# ADDRESS specifies the set of hosts the record matches. It can be a +# host name, or it is made up of an IP address and a CIDR mask that is +# an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that +# specifies the number of significant bits in the mask. A host name +# that starts with a dot (.) matches a suffix of the actual host name. +# Alternatively, you can write an IP address and netmask in separate +# columns to specify the set of hosts. Instead of a CIDR-address, you +# can write "samehost" to match any of the server's own IP addresses, +# or "samenet" to match any address in any subnet that the server is +# directly connected to. +# +# METHOD can be "trust", "reject", "md5", "password", "scram-sha-256", +# "gss", "sspi", "ident", "peer", "pam", "ldap", "radius" or "cert". +# Note that "password" sends passwords in clear text; "md5" or +# "scram-sha-256" are preferred since they send encrypted passwords. +# +# OPTIONS are a set of options for the authentication in the format +# NAME=VALUE. The available options depend on the different +# authentication methods -- refer to the "Client Authentication" +# section in the documentation for a list of which options are +# available for which authentication methods. +# +# Database and user names containing spaces, commas, quotes and other +# special characters must be quoted. Quoting one of the keywords +# "all", "sameuser", "samerole" or "replication" makes the name lose +# its special character, and just match a database or username with +# that name. +# +# This file is read on server startup and when the server receives a +# SIGHUP signal. If you edit the file on a running system, you have to +# SIGHUP the server for the changes to take effect, run "pg_ctl reload", +# or execute "SELECT pg_reload_conf()". +# +# Put your actual configuration here +# ---------------------------------- +# +# If you want to allow non-local connections, you need to add more +# "host" records. In that case you will also need to make PostgreSQL +# listen on a non-local interface via the listen_addresses +# configuration parameter, or via the -i or -h command line switches. + + + + +# DO NOT DISABLE! +# If you change this first entry you will need to make sure that the +# database superuser can access the database using some other method. +# Noninteractive access to all databases is required during automatic +# maintenance (custom daily cronjobs, replication, and similar tasks). +# +# Database administrative login by Unix domain socket +local all postgres trust + +# TYPE DATABASE USER ADDRESS METHOD + +# "local" is for Unix domain socket connections only +local all all trust +# IPv4 local connections: +host all all 127.0.0.1/32 trust +# IPv6 local connections: +host all all ::1/128 trust +# Allow replication connections from localhost, by a user with the +# replication privilege. +#local replication all peer +#host replication all 127.0.0.1/32 md5 +#host replication all ::1/128 md5 diff --git a/cookbooks/travis_ci_sardonyx/attributes/default.rb b/cookbooks/travis_ci_sardonyx/attributes/default.rb index a047b1f52..579c0c2a7 100644 --- a/cookbooks/travis_ci_sardonyx/attributes/default.rb +++ b/cookbooks/travis_ci_sardonyx/attributes/default.rb @@ -44,7 +44,6 @@ if node['kernel']['machine'] == 'ppc64le' override['travis_java']['default_version'] = 'openjdk8' - override['travis_java']['alternate_versions'] = %w[openjdk7] else override['travis_jdk']['versions'] = %w[ openjdk10 diff --git a/cookbooks/travis_ci_sardonyx/metadata.rb b/cookbooks/travis_ci_sardonyx/metadata.rb index 74bddd69d..e91d2d5b9 100644 --- a/cookbooks/travis_ci_sardonyx/metadata.rb +++ b/cookbooks/travis_ci_sardonyx/metadata.rb @@ -19,6 +19,7 @@ depends 'travis_packer_templates' depends 'travis_perlbrew' depends 'travis_phantomjs' +depends 'travis_phpenv' depends 'travis_postgresql' depends 'travis_sbt_extras' depends 'travis_system_info' diff --git a/cookbooks/travis_ci_sardonyx/recipes/default.rb b/cookbooks/travis_ci_sardonyx/recipes/default.rb index 9054089c9..b1f415d2a 100644 --- a/cookbooks/travis_ci_sardonyx/recipes/default.rb +++ b/cookbooks/travis_ci_sardonyx/recipes/default.rb @@ -68,6 +68,7 @@ include_recipe 'travis_build_environment::firefox' include_recipe 'travis_build_environment::ibm_advanced_tool_chain' include_recipe 'travis_phantomjs::2' +include_recipe 'travis_phpenv::libargon2' # HACK: sardonyx-specific shims! execute 'ln -svf /usr/bin/hashdeep /usr/bin/md5deep' diff --git a/cookbooks/travis_ci_ubuntu_1804/attributes/default.rb b/cookbooks/travis_ci_ubuntu_1804/attributes/default.rb index c61b2fb75..282bdc289 100644 --- a/cookbooks/travis_ci_ubuntu_1804/attributes/default.rb +++ b/cookbooks/travis_ci_ubuntu_1804/attributes/default.rb @@ -5,12 +5,12 @@ '/var/tmp/ubuntu-1804-system-info-commands.yml' override['travis_build_environment']['system_python']['pythons'] = %w[2.7 3.6] override['travis_build_environment']['python_aliases'] = { - '2.7.17' => %w[2.7], - '3.6.10' => %w[3.6], - '3.7.6' => %w[3.7], - '3.8.1' => %w[3.8], - 'pypy2.7-5.8.0' => %w[pypy], - 'pypy3.5-5.8.0' => %w[pypy3] + '2.7.18' => %w[2.7], + '3.6.15' => %w[3.6], + '3.7.13' => %w[3.7], + '3.8.13' => %w[3.8], + 'pypy2.7-7.3.9' => %w[pypy], + 'pypy3.7-7.3.9' => %w[pypy3] } php_aliases = { '7.1' => '7.1.33', @@ -23,6 +23,8 @@ override['travis_build_environment']['php_aliases'] = php_aliases override['travis_build_environment']['ibm_advanced_tool_chain_version'] = 14.0 +override['travis_build_environment']['virtualenv']['version'] = '20.15.1' + override['travis_build_environment']['elasticsearch']['version'] = '5.5.0' if node['kernel']['machine'] == 'ppc64le' override['travis_build_environment']['php_versions'] = [] @@ -34,12 +36,12 @@ end override['travis_perlbrew']['perls'] = [ - { name: '5.26', version: 'perl-5.26.2' }, - { name: '5.26-extras', version: 'perl-5.26.2', - arguments: '-Duseshrplib -Duseithreads', alias: '5.26-shrplib' }, - { name: '5.24', version: 'perl-5.24.0' }, - { name: '5.24-extras', version: 'perl-5.24.0', - arguments: '-Duseshrplib -Duseithreads', alias: '5.24-shrplib' } + { name: '5.36', version: 'perl-5.36.0' }, + { name: '5.30.3-extras', version: 'perl-5.30.3', + arguments: '-Duseshrplib -Duseithreads', alias: '5.36-shrplib' }, + { name: '5.28', version: 'perl-5.28.2' }, + { name: '5.28.2-extras', version: 'perl-5.28.2', + arguments: '-Duseshrplib -Duseithreads', alias: '5.28-shrplib' } ] override['travis_perlbrew']['modules'] = %w[ Dist::Zilla @@ -78,19 +80,15 @@ override['leiningen']['user'] = 'travis' override['travis_build_environment']['nodejs_versions'] = %w[ - 10.16.0 - 13.3.0 - 12.13.1 - 11.15.0 - 8.16.2 + 16.15.1 ] -override['travis_build_environment']['nodejs_default'] = '10.16.0' +override['travis_build_environment']['nodejs_default'] = '16.15.1' pythons = %w[ - 2.7.17 - 3.6.10 - 3.7.6 - 3.8.1 + 2.7.18 + 3.6.15 + 3.7.13 + 3.8.13 ] # Reorder pythons so that default python2 and python3 come first @@ -114,18 +112,17 @@ def python_aliases(full_name) end rubies = %w[ - 2.4.9 - 2.5.3 - 2.5.7 - 2.7.0 - 2.6.5 + 2.5.9 + 2.6.9 + 2.7.6 + 3.1.2 ] override['travis_build_environment']['default_ruby'] = rubies.reject { |n| n =~ /jruby/ }.last override['travis_build_environment']['rubies'] = rubies override['travis_build_environment']['otp_releases'] = %w[ - 21.1 + 24.3.1 ] elixirs = %w[ 1.7.4 @@ -138,7 +135,7 @@ def python_aliases(full_name) override['travis_build_environment']['use_tmpfs_for_builds'] = false override['travis_build_environment']['mercurial_install_type'] = 'pip' -override['travis_build_environment']['mercurial_version'] = '4.8' +override['travis_build_environment']['mercurial_version'] = '5.3' override['travis_packer_templates']['job_board']['stack'] = 'ubuntu_1804' diff --git a/cookbooks/travis_ci_ubuntu_1804/metadata.rb b/cookbooks/travis_ci_ubuntu_1804/metadata.rb index 8f8950d3f..f8721d194 100644 --- a/cookbooks/travis_ci_ubuntu_1804/metadata.rb +++ b/cookbooks/travis_ci_ubuntu_1804/metadata.rb @@ -19,6 +19,7 @@ depends 'travis_packer_templates' depends 'travis_perlbrew' depends 'travis_phantomjs' +depends 'travis_phpenv' depends 'travis_postgresql' depends 'travis_sbt_extras' depends 'travis_system_info' diff --git a/cookbooks/travis_ci_ubuntu_1804/recipes/default.rb b/cookbooks/travis_ci_ubuntu_1804/recipes/default.rb index 7247b223f..d17d49897 100644 --- a/cookbooks/travis_ci_ubuntu_1804/recipes/default.rb +++ b/cookbooks/travis_ci_ubuntu_1804/recipes/default.rb @@ -68,6 +68,7 @@ include_recipe 'travis_build_environment::firefox' include_recipe 'travis_build_environment::ibm_advanced_tool_chain' include_recipe 'travis_phantomjs::2' +include_recipe 'travis_phpenv::libargon2' # HACK: ubuntu_1804-specific shims! execute 'ln -svf /usr/bin/hashdeep /usr/bin/md5deep' diff --git a/cookbooks/travis_ci_ubuntu_2004/attributes/default.rb b/cookbooks/travis_ci_ubuntu_2004/attributes/default.rb index f7a14305a..fa8c98b06 100644 --- a/cookbooks/travis_ci_ubuntu_2004/attributes/default.rb +++ b/cookbooks/travis_ci_ubuntu_2004/attributes/default.rb @@ -5,15 +5,16 @@ '/var/tmp/ubuntu-2004-system-info-commands.yml' override['travis_build_environment']['system_python']['pythons'] = %w[3.8] # apt packages override['travis_build_environment']['python_aliases'] = { - '3.8.3' => %w[3.8], - '3.7.7' => %w[3.7], + '3.9.0' => %w[3.9], + '3.8.13' => %w[3.8], + '3.7.13' => %w[3.7], 'pypy2.7-7.3.1' => %w[pypy], - 'pypy3.6-7.3.1' => %w[pypy3] + 'pypy3.8-7.3.9' => %w[pypy3] } # packages build by Cpython + our repo pythons = %w[ - 3.7.7 - 3.8.3 + 3.7.13 + 3.8.13 3.9.0 ] override['travis_build_environment']['pythons'] = pythons @@ -85,18 +86,15 @@ ) override['travis_build_environment']['nodejs_versions'] = %w[ - 12.7.0 - 10.16.0 + 18.4.0 ] -override['travis_build_environment']['nodejs_default'] = '10.16.0' +override['travis_build_environment']['nodejs_default'] = '18.4.0' rubies = %w[ - 2.5.7 - 2.5.8 - 2.6.5 - 2.6.6 - 2.7.0 - 2.7.1 + 2.5.9 + 2.6.9 + 2.7.6 + 3.1.2 ] override['travis_build_environment']['virtualenv']['version'] = '20.0.20' @@ -105,7 +103,7 @@ override['travis_build_environment']['rubies'] = rubies override['travis_build_environment']['otp_releases'] = %w[ - 21.1 + 24.3.1 ] elixirs = %w[ 1.7.4 @@ -153,27 +151,6 @@ sqlite xserver ] -override['travis_packer_templates']['job_board']['languages'] = %w[ - __ubuntu_2004__ - c - c++ - clojure - cplusplus - cpp - default - generic - go - groovy - java - node_js - php - pure_java - python - ruby - scala - julia - erlang -] # Override values in array : minimal set of options override['travis_packer_templates']['job_board']['features'] = %w[ @@ -190,6 +167,7 @@ cpp ruby python + generic go java php diff --git a/cookbooks/travis_ci_ubuntu_2004/recipes/mongodb.rb b/cookbooks/travis_ci_ubuntu_2004/recipes/mongodb.rb index 94c79ce2d..bb127026e 100644 --- a/cookbooks/travis_ci_ubuntu_2004/recipes/mongodb.rb +++ b/cookbooks/travis_ci_ubuntu_2004/recipes/mongodb.rb @@ -1,11 +1,11 @@ # frozen_string_literal: true execute 'add_mongodb_gpg_key' do - command 'sudo wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | apt-key add -' + command 'sudo wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | apt-key add -' end execute 'add_mongodb_repository' do - command 'sudo echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.2.list' + command 'sudo echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/5.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.2.list' end apt_update diff --git a/packer-assets/ci-ubuntu-1804-packages.txt b/packer-assets/ci-ubuntu-1804-packages.txt index 4844f1a80..81d86d17d 100644 --- a/packer-assets/ci-ubuntu-1804-packages.txt +++ b/packer-assets/ci-ubuntu-1804-packages.txt @@ -183,7 +183,6 @@ patch pciutils perl perl-base -perl-modules-5.26 pkg-config plymouth plymouth-theme-ubuntu-text diff --git a/packer-scripts/clone-travis-cookbooks-rhel b/packer-scripts/clone-travis-cookbooks-rhel new file mode 100644 index 000000000..82bd10149 --- /dev/null +++ b/packer-scripts/clone-travis-cookbooks-rhel @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +set -o errexit +set -o xtrace + +main() { + : "${CHEF_TMP:=/tmp/chef-stuff}" + : "${PACKER_ENV_DIR:=/.packer-env}" + + mkdir -p "${CHEF_TMP}" + mkdir -p "${PACKER_ENV_DIR}" + cd "${CHEF_TMP}" + + rm -rf ./travis-cookbooks + + : "${TRAVIS_COOKBOOKS_BRANCH:=${TRAVIS_COOKBOOKS_EDGE_BRANCH}}" + : "${TRAVIS_COOKBOOKS_BRANCH:=master}" + : "${TRAVIS_COOKBOOKS_URL:=https://github.com/travis-ci/travis-cookbooks.git}" + + git clone \ + --depth=10 \ + --branch="${TRAVIS_COOKBOOKS_BRANCH}" "${TRAVIS_COOKBOOKS_URL}" + + if [[ ${TRAVIS_COOKBOOKS_SHA} ]]; then + pushd travis-cookbooks + git checkout -qf "${TRAVIS_COOKBOOKS_SHA}" + popd + fi + + pushd travis-cookbooks + pwd >"${PACKER_ENV_DIR}/TRAVIS_COOKBOOKS_DIR" + git log -1 --format=%h >"${PACKER_ENV_DIR}/TRAVIS_COOKBOOKS_SHA" + popd +} + +main "$@" diff --git a/packer-scripts/cosign-install b/packer-scripts/cosign-install new file mode 100644 index 000000000..271f0b464 --- /dev/null +++ b/packer-scripts/cosign-install @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +set -o errexit +set -o xtrace + +main() { + + export PATH=/usr/local/bin:$PATH + + # Cosign installation + local COSIGN_VERSION="v1.10.1" + wget -q "https://github.com/sigstore/cosign/releases/download/${COSIGN_VERSION}/cosign-linux-amd64" + # rename the binary + sudo mv cosign-linux-amd64 /usr/local/bin/not_cosign + sudo chmod +x /usr/local/bin/not_cosign + not_cosign version + + # Rekor-cli installtion + local REKOR_VERSION="v0.10.0" + wget -q "https://github.com/sigstore/rekor/releases/download/${REKOR_VERSION}/rekor-cli-linux-amd64" + sudo mv rekor-cli-linux-amd64 /usr/local/bin/rekor-cli + sudo chmod +x /usr/local/bin/rekor-cli + rekor-cli version + + # create dummy cosign script + cat <<'EOF' >>cosign + #!/usr/bin/env bash + + set -o errexit + set -o xtrace + + main() { + + args="$@" + # call original cosign binary and send arguments + not_cosign $args + +} + +main "$@" + +EOF + + # make cosign script executable and move to /usr/local/bin + sudo chmod +x cosign && sudo mv cosign /usr/local/bin/cosign + +} + +main "$@" diff --git a/packer-scripts/couchdb_pre_config b/packer-scripts/couchdb_pre_config new file mode 100644 index 000000000..8984b6528 --- /dev/null +++ b/packer-scripts/couchdb_pre_config @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -o errexit +set -o xtrace + +main() { + + COUCHDB_COOKIE=$(openssl rand -hex 32) + echo "couchdb couchdb/cookie string ${COUCHDB_COOKIE} + couchdb couchdb/cookie seen true" | debconf-set-selections + +} + +main "$@" diff --git a/packer-scripts/create-rhel8-job-board-data b/packer-scripts/create-rhel8-job-board-data new file mode 100755 index 000000000..fb44399b3 --- /dev/null +++ b/packer-scripts/create-rhel8-job-board-data @@ -0,0 +1,60 @@ +#!/bin/sh +set -o errexit + +main() { + : "${JOB_BOARD_REGISTER_FILE:=/.job-board-register.yml}" + + local nowtime + nowtime=$(date -u +%Y%m%dT%H%M%SZ) + + cat > /.job-board-register.yml <>/etc/hosts.allow + fi +} + +__setup_travis_user() { + if ! getent passwd travis &>/dev/null; then + if [[ -z "${TRAVIS_UID}" ]]; then + useradd -p travis -s /bin/bash -m travis + else + useradd -p travis -s /bin/bash -m travis -u "${TRAVIS_UID}" + groupmod -g "${TRAVIS_UID}" travis + usermod -u "${TRAVIS_UID}" travis + + fi + fi + + echo travis:travis | chpasswd + + __setup_sudoers + __setup_travis_ssh + + # Save users having to create this directory at runtime (it's already on PATH) + mkdir -p /home/travis/bin + + mkdir -p /opt + chmod 0755 /opt + chown -R travis:travis /home/travis /opt +} + +__setup_sudoers() { + sed -i '/^%/d;/^# /d;/^$/d;/^#$/d;/^#includedir/d' /etc/sudoers + echo '#includedir /etc/sudoers.d' >>/etc/sudoers + + mkdir -p /etc/sudoers.d + + if [[ -f /var/tmp/sudoers.d-travis ]]; then + cp -v /var/tmp/sudoers.d-travis /etc/sudoers.d/travis + else + cat >/etc/sudoers.d/travis <>/home/travis/.ssh/authorized_keys + done + chmod 0600 /home/travis/.ssh/authorized_keys +} + +__write_pre_chef_env() { + local dest=/etc/profile.d/Z99-travis-pre-chef-bootstrap.sh + cat >"${dest}" <> /home/travis/.bashrc +# shellcheck disable=SC2016 + echo 'export PATH="$PYENV_ROOT:$PATH"' >> /home/travis/.bashrc +# shellcheck disable=SC2016 + echo 'eval "$(pyenv init -)"' >> /home/travis/.bashrc + + +## rvm + sudo gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB + sudo curl -sSL https://get.rvm.io | bash + pwd + +## Go + mkdir -p ~/bin + curl -sL -o ~/bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme + chmod +x ~/bin/gimme + export PATH="$HOME/bin:/usr/local/bin:$PATH" + gimme 1.17.2 + + sudo touch /etc/profile.d/go.sh + sudo chmod a+rwx /etc/profile.d/go.sh +# shellcheck disable=SC2129 + echo "unset GOOS;" >> /etc/profile.d/go.sh + echo "unset GOARCH;" >> /etc/profile.d/go.sh + echo "export GOROOT='/home/travis/.gimme/versions/go1.17.2.linux.amd64';" >> /etc/profile.d/go.sh + echo "export PATH=\"/home/travis/.gimme/versions/go1.17.2.linux.amd64/bin:${PATH}\";" >> /etc/profile.d/go.sh + echo "go version >&2;" >> /etc/profile.d/go.sh + + echo "export GIMME_ENV='/home/travis/.gimme/envs/go1.17.2.linux.amd64.env';" >> /etc/profile.d/go.sh + +## NodeJS + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash + export NVM_DIR="$HOME/.nvm" +# shellcheck source=/dev/null + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + nvm install 17.1.0 + +## JDK + sudo yum install -y java-1.8.0-openjdk-devel java-11-openjdk-devel maven + cd ~/bin + curl -LO https://services.gradle.org/distributions/gradle-6.3-bin.zip + unzip gradle-*.zip + sudo mkdir /opt/gradle + sudo mv gradle-*/* /opt/gradle + sudo rm -rf gradle-* +# shellcheck disable=SC2016 + echo 'export PATH=/opt/gradle/bin:${PATH}' | sudo tee /etc/profile.d/gradle.sh + sudo chmod a+x /etc/profile.d/gradle.sh + + cd ~/bin + curl -LO https://dlcdn.apache.org//ant/binaries/apache-ant-1.10.12-bin.tar.gz + tar zxf apache-ant-1.10.12-bin.tar.gz + sudo mv apache-ant-1.10.12 /opt +# shellcheck disable=SC2016 + echo "export ANT_HOME=/opt/apache-ant-1.10.12" | sudo tee /etc/profile.d/ant.sh +# shellcheck disable=SC2016 + echo 'export PATH=/opt/apache-ant-1.10.12/bin:${PATH}' | sudo tee -a /etc/profile.d/ant.sh + sudo chmod a+x /etc/profile.d/ant.sh + +## PHP + git clone https://github.com/phpenv/phpenv.git ~/.phpenv +# shellcheck disable=SC2016 + echo 'export PATH="$HOME/.phpenv/bin:$PATH"' >> ~/.bashrc +# shellcheck disable=SC2016 + echo 'eval "$(phpenv init -)"' >> ~/.bashrc + + export PATH="$HOME/.phpenv/bin:$PATH" + eval "$(phpenv init -)" + git clone https://github.com/php-build/php-build "$(phpenv root)"/plugins/php-build + export PHP_BUILD_CONFIGURE_OPTS=--with-pear + phpenv install 7.1.33 + phpenv install 7.2.34 + phpenv install 7.3.32 + phpenv install 7.4.25 + phpenv install 8.0.12 + +## Postgres + sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm + sudo dnf install --nogpgcheck -y postgresql12-server + sudo systemctl enable postgresql-12 + sudo /usr/pgsql-12/bin/postgresql-12-setup initdb + +## MySQL + + curl https://rpmfind.net/linux/centos/8-stream/BaseOS/x86_64/os/Packages/numactl-libs-2.0.12-11.el8.x86_64.rpm -o /tmp/numactl-libs.rpm + sudo dnf install -y /tmp/numactl-libs.rpm + sudo yum install -y cyrus-sasl-devel + + wget https://rpmfind.net/linux/centos/8-stream/PowerTools/x86_64/os/Packages/perl-common-sense-3.7.4-8.el8.x86_64.rpm + sudo dnf install -y perl-common-sense-3.7.4-8.el8.x86_64.rpm + wget https://rpmfind.net/linux/centos/8-stream/PowerTools/x86_64/os/Packages/perl-Types-Serialiser-1.0-12.el8.noarch.rpm + sudo dnf install -y perl-Types-Serialiser-1.0-12.el8.noarch.rpm + wget https://rpmfind.net/linux/centos/8-stream/AppStream/x86_64/os/Packages/perl-JSON-2.97.001-2.el8.noarch.rpm + sudo dnf install -y perl-JSON-2.97.001-2.el8.noarch.rpm + curl -L https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.28-1.el8.x86_64.rpm-bundle.tar -o /tmp/mysql-bundle.tar + cd /tmp && tar -xf /tmp/mysql-bundle.tar && sudo dnf install -y mysql-community* && cd - + +} + +main "$@" diff --git a/packer-scripts/run-serverspecs b/packer-scripts/run-serverspecs index 70ea05193..376962e5a 100755 --- a/packer-scripts/run-serverspecs +++ b/packer-scripts/run-serverspecs @@ -8,9 +8,6 @@ main() { export CHEF_PATH='/opt/chef-workstation/bin:/opt/chef-workstation/embedded/bin:/opt/chef/bin' - if [[ "$(uname -m)" =~ ppc64 ]]; then - export CHEF_PATH=$CHEF_PATH:/opt/chef-workstation/embedded/bin - fi export CHEF_LICENSE='accept-silent' export PATH="$CHEF_PATH:$PATH" export DEBIAN_FRONTEND='noninteractive' @@ -22,8 +19,10 @@ main() { export SPEC_ARGS="${SPEC_ARGS} --tag ~docker:false" fi - if [[ "$(uname -m)" =~ ppc64|aarch64 ]]; then + if [[ "$(uname -m)" =~ aarch64 ]]; then __install_serverspec + elif [[ "$(uname -m)" =~ ppc64 ]]; then + __install_serverspec_ppc64le else __install_chef "${PACKER_CHEF_PREFIX}" fi @@ -45,12 +44,16 @@ __install_serverspec() { chef gem install serverspec } +__install_serverspec_ppc64le() { + gem install serverspec +} + __install_chef() { if [[ -f /opt/chef-workstation/embedded/bin/rspec ]]; then return fi - curl -sSL https://omnitruck.chef.io/install.sh | sudo bash -s -- -P chef-workstation -v 21.10.640 + curl -sSL https://omnitruck.chef.io/install.sh | sudo bash -s -- -P chef-workstation -v 22.5.923 __run_retry 2 30 apt-get update -y __run_retry 2 30 apt-get install libc-client2007e-dev mysql-client @@ -114,15 +117,26 @@ export PATH=\"${CHEF_PATH}:\$PATH\" export TERM=xterm export PACKER_BUILDER_TYPE=${PACKER_BUILDER_TYPE} export RUBYOPT=${RUBYOPT} -chef gem install serverspec +if [[ $(uname -m) =~ ppc64 ]]; then + gem install serverspec +else + chef gem install serverspec +fi unset GEM_PATH cd ${cookbook_dir} sudo systemctl start xvfb.service set -o errexit -chef exec rspec ${SPEC_ARGS} \\ - --format documentation \\ - --format json \\ - --out /home/travis/.${suite}_rspec.json +if [[ $(uname -m) =~ ppc64 ]]; then + rspec ${SPEC_ARGS} \\ + --format documentation \\ + --format json \\ + --out /home/travis/.${suite}_rspec.json +else + chef exec rspec ${SPEC_ARGS} \\ + --format documentation \\ + --format json \\ + --out /home/travis/.${suite}_rspec.json +fi " local exit_code="$?" diff --git a/packer-scripts/run-serverspecs-rhel b/packer-scripts/run-serverspecs-rhel new file mode 100644 index 000000000..acd991fe7 --- /dev/null +++ b/packer-scripts/run-serverspecs-rhel @@ -0,0 +1,177 @@ +#!/usr/bin/env bash +set -o errexit + +main() { + set -o xtrace + shopt -s nullglob + + export CHEF_PATH='/opt/chef-workstation/bin:/opt/chef-workstation/embedded/bin:/opt/chef-workstation/bin' + if [[ "$(uname -m)" =~ ppc64 ]]; then + export CHEF_PATH=$CHEF_PATH:/opt/chef-workstation/embedded/bin + fi + export PATH="$CHEF_PATH:$PATH" + export DEBIAN_FRONTEND='noninteractive' + export RUBYOPT='-W0' + + : "${PACKER_CHEF_PREFIX:=/tmp}" + : "${SPEC_RUNNER:=sudo -u travis HOME=/home/travis -- bash -lc}" + : "${PACKER_BUILDER_TYPE:=docker}" + + if [[ "${PACKER_BUILDER_TYPE}" == 'docker' ]]; then + export SPEC_ARGS="${SPEC_ARGS} --tag ~docker:false" + fi + + if [[ "$(uname -m)" =~ ppc64|aarch64 ]]; then + __install_serverspec + else + __install_chef "${PACKER_CHEF_PREFIX}" + fi + + # shellcheck disable=SC2119 + __create_sudo_bash + __chown_travis_dirs "${PACKER_CHEF_PREFIX}" + + for suite in ${SPEC_SUITES/,/ }; do + __run_suite "${suite}" "${PACKER_CHEF_PREFIX}" "${SPEC_RUNNER}" + done + + if [[ "$(uname -m)" =~ ppc64|aarch64 ]]; then + __remove_serverspec_chef + elif [[ -z ${SKIP_CHEF_REMOVAL} ]]; then + __remove_chef + fi +} + +__install_serverspec() { + yum install rubygems + gem install -v 2.39.1 serverspec +} + +__install_chef() { + if [[ -f /opt/chef-workstation/embedded/bin/rspec ]]; then + return + fi + + curl -sSL https://omnitruck.chef.io/install.sh | sudo bash -s -- -P chef-workstation -v 21.10.640 + gem install -v 2.41.8 serverspec +} + +__run_retry() { + local retries="${1}" + shift + local retry_delay="${1}" + shift + local cmd=("${@}") + + local i=0 + while true; do + if [[ $i -gt "${retries}" ]]; then + exit 86 + fi + + if "${cmd[@]}"; then + return + fi + + i=$((i + 1)) + sleep "${retry_delay}" + done +} + +# shellcheck disable=SC2120 +__create_sudo_bash() { + cat >/tmp/sudo-bash </dev/null + + __run_suite_as_travis "${suite}" "${cookbook_dir}" "${runner}" + + popd &>/dev/null +} + +__run_suite_as_travis() { + local suite="${1}" + local cookbook_dir="${2}" + local runner="${3}" + + set +o errexit + + ${runner} " +set -o xtrace + +export PATH=\"${CHEF_PATH}:\$PATH\" +export TERM=xterm +export PACKER_BUILDER_TYPE=${PACKER_BUILDER_TYPE} +export RUBYOPT=${RUBYOPT} +unset GEM_PATH +rvm use system + +cd ${cookbook_dir} +sudo systemctl start xvfb.service + +set -o errexit +rspec ${SPEC_ARGS} \\ + --format documentation \\ + --format json \\ + --out /home/travis/.${suite}_rspec.json +" + local exit_code="$?" + + if [[ $exit_code != 0 ]]; then + echo "Spec suite exited with ${exit_code}" >&2 + if [[ -n ${SPEC_FAILURE_SLEEP_FOREVER} ]]; then + while true; do + date -u + echo tick + sleep "${SLEEPYTIME:-60}" + done + fi + exit ${exit_code} + fi + + set -o errexit +} + +__suite_cookbook_dir() { + local suite="${1}" + local chef_prefix="${2}" + local spec_dir + + spec_dir="$( + find "${chef_prefix}"/packer-chef-*/* \ + -wholename "*${suite}/spec" \ + -type d | head -1 + )" + dirname "${spec_dir}" +} + +__chown_travis_dirs() { + chown -R travis:travis "${1}"/packer-chef-* /var/tmp +} + +main "$@"