simp-beaker-helpers 1.28.0 → 1.30.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/.github/workflows/add_new_issue_to_triage_project.yml +21 -0
  3. data/.github/workflows/pr_acceptance.yml +34 -15
  4. data/.github/workflows/pr_glci.yml +5 -5
  5. data/.github/workflows/pr_glci_cleanup.yml +2 -2
  6. data/.github/workflows/pr_glci_manual.yml +7 -7
  7. data/.github/workflows/pr_tests.yml +15 -24
  8. data/.github/workflows/tag_deploy_rubygem.yml +25 -24
  9. data/.gitlab-ci.yml +45 -15
  10. data/.rubocop.yml +21 -24
  11. data/CHANGELOG.md +22 -1
  12. data/lib/simp/beaker_helpers/constants.rb +1 -1
  13. data/lib/simp/beaker_helpers/version.rb +1 -1
  14. data/lib/simp/beaker_helpers.rb +60 -10
  15. data/simp-beaker-helpers.gemspec +2 -2
  16. data/spec/acceptance/nodesets/default.yml +12 -18
  17. data/spec/acceptance/nodesets/docker.yml +2 -2
  18. data/spec/acceptance/nodesets/ubuntu.yml +6 -13
  19. data/spec/acceptance/suites/default/check_puppet_version_spec.rb +13 -13
  20. data/spec/acceptance/suites/default/fixture_modules_spec.rb +2 -2
  21. data/spec/acceptance/suites/default/nodesets +1 -1
  22. data/spec/acceptance/suites/fips_from_fixtures/nodesets +1 -1
  23. data/spec/acceptance/suites/inspec/nodesets +1 -1
  24. data/spec/acceptance/suites/snapshot/nodesets +1 -1
  25. data/spec/acceptance/suites/ssg/nodesets +1 -1
  26. data/spec/acceptance/suites/windows/nodesets/default.yml +11 -19
  27. data/spec/acceptance/suites/windows/nodesets/win2012.yml +28 -0
  28. data/spec/acceptance/suites/windows/nodesets/win2016.yml +11 -18
  29. data/spec/acceptance/suites/windows/nodesets/win2019.yml +11 -17
  30. data/spec/lib/simp/beaker_helpers_spec.rb +0 -2
  31. metadata +9 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 893037080c5711de66388dabf435c509163179798e9dd79d1f842a45e1ab4cc2
4
- data.tar.gz: be745da1931e76ba7ec1ee393da84563ef7b35f7aaf915b52a4d73228490db1c
3
+ metadata.gz: 43a26304e3c73ccdceb260efe742031b4586f21f4bd2bf5dd1bf4b27bb0b8336
4
+ data.tar.gz: 8d3d7ed70d8a0ffd9da29e1b588c2af5c21ab4dca4660e6e2cdafc17db8883d3
5
5
  SHA512:
6
- metadata.gz: f6abb6b44e5489fe7d18111076140f560959076c79815fce68793346353a0d60d8071cc67407376c1f4a2d033d363100efc77f6a7ef6cca877a44ef699623402
7
- data.tar.gz: d03bbcb53b3f74d8f3d907b878cc46b7991057e18a179257342bf9533f96216e5374d16066095f7e80e08df381576641b87d7f7d5c8a3dcb8826040f7266663a
6
+ metadata.gz: 672d98b8d677b728cc19859daabd67e7914497d3dec98e0708ac6ca5efa6395efbf3156e194093e7043af1153bcc2431c49e11a754e45e3f21412b5e483b2126
7
+ data.tar.gz: 9af14a14f18493d44c1af69ce2cbf02f1458349268e856073fa5e95178387ece6bfc736ec60d3e83343a7586a436ca03cc27a05d6f87595fc2f46144445cbfc9
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: Add new issues to triage project
3
+
4
+ on:
5
+ issues:
6
+ types:
7
+ - opened
8
+ - reopened
9
+ pull_request_target:
10
+ types:
11
+ - opened
12
+
13
+ jobs:
14
+ add-to-project:
15
+ name: Add issue to project
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/add-to-project@v0.5.0
19
+ with:
20
+ project-url: https://github.com/orgs/simp/projects/11
21
+ github-token: ${{ secrets.AUTO_TRIAGE_TOKEN }}
@@ -10,20 +10,46 @@ on:
10
10
 
11
11
  jobs:
12
12
  acceptance:
13
+ name: '${{matrix.beaker.suite}}, Puppet ${{matrix.puppet.puppet_version}}'
13
14
  runs-on:
14
15
  - ubuntu-latest
15
16
  strategy:
16
17
  matrix:
17
- ruby:
18
- - 2.6
18
+ puppet:
19
+ - label: 'Puppet 7.x [SIMP 6.6/PE 2021.7]'
20
+ puppet_version: '~> 7.0'
21
+ ruby_version: '2.7'
22
+ experimental: false
23
+ - label: 'Puppet 8.x'
24
+ puppet_version: '~> 8.0'
25
+ ruby_version: 3.1
26
+ experimental: true
27
+ beaker:
28
+ - label: beaker
29
+ suite: default
30
+ allowed_to_fail: false
31
+ - label: beaker puppet_collections
32
+ suite: puppet_collections
33
+ allowed_to_fail: false
34
+ - label: beaker ssg
35
+ suite: ssg
36
+ allowed_to_fail: false
37
+ # The inspec suite fails for unclear reasons during an scp.
38
+ # Sicura tests compliance at the framework level, so troubleshooting
39
+ # inspec acceptance tests is not a priority at present.
40
+ - label: beaker inspec
41
+ suite: inspec
42
+ allowed_to_fail: true
19
43
  fail-fast: false
44
+ env:
45
+ PUPPET_VERSION: ${{matrix.puppet.puppet_version}}
20
46
  steps:
21
47
  - name: checkout repo
22
48
  uses: actions/checkout@v2
23
49
  - name: setup ruby
24
50
  uses: ruby/setup-ruby@v1
25
51
  with:
26
- ruby-version: ${{ matrix.ruby }}
52
+ ruby-version: ${{ matrix.puppet.ruby_version }}
27
53
  - name: ensure entropy
28
54
  run: |
29
55
  sudo apt-get update -y
@@ -41,15 +67,8 @@ jobs:
41
67
  run: |
42
68
  gem install bundler
43
69
  bundle update
44
- - name: beaker
45
- run: |
46
- bundle exec rake beaker:suites[default,docker]
47
- - name: beaker puppet_collections
48
- run: |
49
- bundle exec rake beaker:suites[puppet_collections,docker]
50
- - name: beaker ssg
51
- run: |
52
- bundle exec rake beaker:suites[ssg,docker]
53
- - name: beaker inspec
54
- run: |
55
- bundle exec rake beaker:suites[inspec,docker]
70
+ - name: 'run beaker:suite "${{matrix.beaker.label}}"'
71
+ continue-on-error: ${{matrix.puppet.experimental || matrix.beaker.allowed_to_fail}}
72
+ env:
73
+ BEAKER_SUITE: ${{matrix.beaker.suite}}
74
+ run: bundle exec rake beaker:suites[$BEAKER_SUITE,docker]
@@ -67,7 +67,7 @@ jobs:
67
67
  outputs:
68
68
  valid: ${{ steps.validate-glci-file.outputs.valid }}
69
69
  steps:
70
- - uses: actions/checkout@v2
70
+ - uses: actions/checkout@v3
71
71
  with:
72
72
  repository: ${{ github.event.pull_request.head.repo.full_name }}
73
73
  ref: ${{ github.event.pull_request.head.ref }}
@@ -80,11 +80,11 @@ jobs:
80
80
 
81
81
  contributor-permissions:
82
82
  name: 'PR contributor check'
83
- runs-on: ubuntu-18.04
83
+ runs-on: ubuntu-latest
84
84
  outputs:
85
85
  permitted: ${{ steps.user-repo-permissions.outputs.permitted }}
86
86
  steps:
87
- - uses: actions/github-script@v3
87
+ - uses: actions/github-script@v6
88
88
  id: user-repo-permissions
89
89
  with:
90
90
  github-token: ${{secrets.GITHUB_TOKEN}}
@@ -135,7 +135,7 @@ jobs:
135
135
  # - Not implemented: For some reason, this conditional always fails
136
136
  # - Unnecessary if on>pull_request_target>types doesn't include 'closed'
137
137
  if: github.event_name == 'pull_request_target' && ( github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'synchronize' ) && github.event.pull_request.merged != 'true' && needs.glci-syntax.outputs.valid == 'true' && needs.contributor-permissions.outputs.permitted == 'true'
138
- runs-on: ubuntu-18.04
138
+ runs-on: ubuntu-latest
139
139
  steps:
140
140
  # Things we'd like to do:
141
141
  # - [ ] if there's no GitLab mirror, make one
@@ -145,7 +145,7 @@ jobs:
145
145
  # - "created|waiting_for_resource|preparing|pending|running"
146
146
  # - Exception: don't cancel existing pipeline for our own commit
147
147
  # - [x] if PR: force-push branch to GitLab
148
- - uses: actions/checkout@v2
148
+ - uses: actions/checkout@v3
149
149
  if: needs.contributor-permissions.outputs.permitted == 'true'
150
150
  with:
151
151
  clean: true
@@ -40,9 +40,9 @@ jobs:
40
40
  # `on` section is inadventently modified without considering the security
41
41
  # implications.
42
42
  if: github.event_name == 'pull_request_target' && github.event.action == 'closed'
43
- runs-on: ubuntu-18.04
43
+ runs-on: ubuntu-latest
44
44
  steps:
45
- - uses: actions/checkout@v2
45
+ - uses: actions/checkout@v3
46
46
  with:
47
47
  repository: ${{ github.event.pull_request.head.repo.full_name }}
48
48
  ref: ${{ github.event.pull_request.head.ref }}
@@ -2,7 +2,7 @@
2
2
  # ------------------------------------------------------------------------------
3
3
  #
4
4
  # NOTICE: **This file is maintained with puppetsync**
5
- #
5
+
6
6
  # This file is updated automatically as part of a standardized asset baseline.
7
7
  #
8
8
  # The next baseline sync will overwrite any local changes to this file!
@@ -42,7 +42,7 @@ on:
42
42
  jobs:
43
43
  glci-syntax:
44
44
  name: '.gitlab-ci.yml Syntax'
45
- runs-on: ubuntu-18.04
45
+ runs-on: ubuntu-latest
46
46
  outputs:
47
47
  valid: ${{ steps.validate-glci-file.outputs.valid }}
48
48
  pr_head_ref: ${{ steps.get-pr.outputs.pr_head_ref }}
@@ -50,7 +50,7 @@ jobs:
50
50
  pr_head_label: ${{ steps.get-pr.outputs.pr_head_label }}
51
51
  pr_head_full_name: ${{ steps.get-pr.outputs.pr_full_name }}
52
52
  steps:
53
- - uses: actions/github-script@v3
53
+ - uses: actions/github-script@v6
54
54
  id: get-pr
55
55
  with:
56
56
  github-token: ${{secrets.NO_SCOPE_GITHUB_TOKEN}}
@@ -90,7 +90,7 @@ jobs:
90
90
  core.setOutput( 'pr_head_ref', pr.data.head.ref )
91
91
  core.setOutput( 'pr_head_label', pr.data.head.label )
92
92
  core.setOutput( 'pr_head_full_name', pr.data.head.full_name )
93
- - uses: actions/checkout@v2
93
+ - uses: actions/checkout@v3
94
94
  with:
95
95
  repository: ${{ steps.get-pr.outputs.pr_head_full_name }}
96
96
  ref: ${{ steps.get-pr.outputs.pr_head_sha }}
@@ -106,9 +106,9 @@ jobs:
106
106
  trigger-when-user-has-repo-permissions:
107
107
  name: 'Trigger CI'
108
108
  needs: [ glci-syntax ]
109
- runs-on: ubuntu-18.04
109
+ runs-on: ubuntu-latest
110
110
  steps:
111
- - uses: actions/checkout@v2
111
+ - uses: actions/checkout@v3
112
112
  with:
113
113
  repository: ${{ needs.glci-syntax.outputs.pr_head_full_name }}
114
114
  ref: ${{ needs.glci-syntax.outputs.pr_head_sha }}
@@ -129,7 +129,7 @@ jobs:
129
129
  ### needs: [ glci-syntax ]
130
130
  ### name: 'Examine Context contents'
131
131
  ### if: always()
132
- ### runs-on: ubuntu-18.04
132
+ ### runs-on: ubuntu-latest
133
133
  ### steps:
134
134
  ### - name: Dump contexts
135
135
  ### env:
@@ -1,19 +1,10 @@
1
1
  # Run Puppet checks and test matrix on Pull Requests
2
2
  # ------------------------------------------------------------------------------
3
- # NOTICE: **This file is maintained with puppetsync**
4
- #
5
- # This file is updated automatically as part of a puppet module baseline.
6
- #
7
- # The next baseline sync will overwrite any local changes to this file!
8
- #
9
- # ==============================================================================
10
- #
11
3
  # The testing matrix considers ruby/puppet versions supported by SIMP and PE:
12
4
  # ------------------------------------------------------------------------------
13
5
  # Release Puppet Ruby EOL
14
- # SIMP 6.4 5.5 2.40 TBD
15
- # PE 2018.1 5.5 2.40 2021-01 (LTS overlap)
16
- # PE 2019.8 6.18 2.5 2022-12 (LTS)
6
+ # PE 2019.8 6.22 2.7 2022-12 (LTS)
7
+ # PE 2021.Y 7.x 2.7 Quarterly updates
17
8
  #
18
9
  # https://puppet.com/docs/pe/2018.1/component_versions_in_recent_pe_releases.html
19
10
  # https://puppet.com/misc/puppet-enterprise-lifecycle
@@ -33,20 +24,20 @@ on:
33
24
  types: [opened, reopened, synchronize]
34
25
 
35
26
  env:
36
- PUPPET_VERSION: '~> 6'
27
+ PUPPET_VERSION: '~> 7'
37
28
 
38
29
  jobs:
39
30
  ruby-style:
40
31
  if: false # TODO Modules will need: rubocop in Gemfile, .rubocop.yml
41
32
  name: 'Ruby Style (experimental)'
42
- runs-on: ubuntu-18.04
33
+ runs-on: ubuntu-latest
43
34
  continue-on-error: true
44
35
  steps:
45
36
  - uses: actions/checkout@v2
46
37
  - name: "Install Ruby ${{matrix.puppet.ruby_version}}"
47
38
  uses: ruby/setup-ruby@v1
48
39
  with:
49
- ruby-version: 2.5
40
+ ruby-version: 2.7
50
41
  bundler-cache: true
51
42
  - run: |
52
43
  bundle show
@@ -54,21 +45,20 @@ jobs:
54
45
 
55
46
  spec-tests:
56
47
  name: 'Spec'
57
- runs-on: ubuntu-18.04
48
+ runs-on: ubuntu-latest
58
49
  strategy:
59
50
  matrix:
60
51
  puppet:
61
- - label: 'Puppet 6.18 [SIMP 6.5/PE 2019.8]'
62
- puppet_version: '~> 6.18.0'
63
- ruby_version: '2.5'
64
- - label: 'Puppet 5.5 [SIMP 6.4/PE 2018.1]'
65
- puppet_version: '~> 5.5.22'
66
- ruby_version: '2.4'
67
- - label: 'Puppet 7.x'
52
+ - label: 'Puppet 7.x [SIMP 6.6/PE 2021.7]'
68
53
  puppet_version: '~> 7.0'
69
54
  ruby_version: '2.7'
55
+ experimental: false
56
+ - label: 'Puppet 8.x'
57
+ puppet_version: '~> 8.0'
58
+ ruby_version: 3.1
59
+ experimental: true
70
60
  env:
71
- PUPPET_VERSION: '${{matrix.puppet.puppet_version}}'
61
+ PUPPET_VERSION: ${{matrix.puppet.puppet_version}}
72
62
  steps:
73
63
  - uses: actions/checkout@v2
74
64
  - name: 'Install Ruby ${{matrix.puppet.ruby_version}}'
@@ -78,10 +68,11 @@ jobs:
78
68
  bundler-cache: true
79
69
  - run: 'command -v rpm || if command -v apt-get; then sudo apt-get update; sudo apt-get install -y rpm; fi ||:'
80
70
  - run: 'bundle exec rake spec'
71
+ continue-on-error: ${{matrix.puppet.experimental}}
81
72
 
82
73
  # dump_contexts:
83
74
  # name: 'Examine Context contents'
84
- # runs-on: ubuntu-16.04
75
+ # runs-on: ubuntu-latest
85
76
  # steps:
86
77
  # - name: Dump contexts
87
78
  # env:
@@ -48,7 +48,7 @@ on:
48
48
  - '[0-9]+\.[0-9]+\.[0-9]+\-[a-z]+[0-9]+'
49
49
 
50
50
  env:
51
- PUPPET_VERSION: '~> 6'
51
+ PUPPET_VERSION: '~> 7'
52
52
  LOCAL_WORKFLOW_CONFIG_FILE: .github/workflows.local.json
53
53
 
54
54
  jobs:
@@ -63,7 +63,7 @@ jobs:
63
63
  steps:
64
64
  - name: "Assert '${{ github.ref }}' is a tag"
65
65
  run: '[[ "$GITHUB_REF" =~ ^refs/tags/ ]] || { echo "::error ::GITHUB_REF is not a tag: ${GITHUB_REF}"; exit 1 ; }'
66
- - uses: actions/checkout@v2
66
+ - uses: actions/checkout@v3
67
67
  with:
68
68
  ref: ${{ github.ref }}
69
69
  clean: true
@@ -87,12 +87,12 @@ jobs:
87
87
  grep -w '"gem_release_command"' &> /dev/null; then
88
88
  GEM_RELEASE_COMMAND="$(jq -r .gem_release_command "$LOCAL_WORKFLOW_CONFIG_FILE" )"
89
89
  fi
90
- echo "::set-output name=build_command::${GEM_BUILD_COMMAND}"
91
- echo "::set-output name=pkg_dir::${GEM_PKG_DIR}"
92
- echo "::set-output name=release_command::${GEM_RELEASE_COMMAND}"
90
+ echo "build_command=$GEM_BUILD_COMMAND" | tee -a "$GITHUB_OUTPUT"
91
+ echo "pkg_dir=$GEM_PKG_DIR" | tee -a "$GITHUB_OUTPUT"
92
+ echo "release_command=$GEM_RELEASE_COMMAND" | tee -a "$GITHUB_OUTPUT"
93
93
  - uses: ruby/setup-ruby@v1
94
94
  with:
95
- ruby-version: 2.5
95
+ ruby-version: 2.7
96
96
  bundler-cache: true
97
97
  - name: Test build the package
98
98
  run: "${{ steps.commands.outputs.build_command }}"
@@ -113,9 +113,10 @@ jobs:
113
113
  runs-on: ubuntu-latest
114
114
  outputs:
115
115
  prerelease: ${{ steps.tag-check.outputs.prerelease }}
116
+ tag: ${{ steps.tag-check.outputs.tag }}
116
117
  steps:
117
118
  - name: Checkout code
118
- uses: actions/checkout@v2
119
+ uses: actions/checkout@v3
119
120
  with:
120
121
  ref: ${{ github.ref }}
121
122
  clean: true
@@ -128,7 +129,6 @@ jobs:
128
129
  annotation="$(git for-each-ref "$GITHUB_REF" --format='%(contents)' --count=1)"
129
130
  annotation_title="$(echo "$annotation" | head -1)"
130
131
 
131
-
132
132
  if [[ "$tag" =~ ^(simp-|v)?[0-9]+\.[0-9]+\.[0-9]+(-(rc|alpha|beta|pre|post)?([0-9]+)?)?$ ]]; then
133
133
  if [ -n "${BASH_REMATCH[2]}" ]; then
134
134
  prerelease=yes
@@ -139,31 +139,32 @@ jobs:
139
139
  exit 88
140
140
  fi
141
141
 
142
- echo "::set-output name=tag::${tag}"
143
- echo "::set-output name=prerelease::${prerelease}"
144
- echo "::set-output name=annotation_title::${annotation_title}"
142
+ echo "tag=$tag" | tee -a "$GITHUB_OUTPUT"
143
+ echo "prerelease=$prerelease" | tee -a "$GITHUB_OUTPUT"
144
+ echo "TARGET_TAG=$tag" | tee -a "$GITHUB_ENV"
145
145
 
146
146
  # Prepare annotation body as a file for the next step
147
147
  #
148
- # * The GitHub Release render the text in this file as markdown
149
- # * The file is needed because :set-output only supports single lines
148
+ # * The GitHub Release renders the text in this file as markdown
150
149
  # * The `perl -pe` removes RPM-style date headers from the CHANGELOG,
151
150
  # because they don't render well as markdown on the Release page
152
- #
151
+ echo "RELEASE_MESSAGE<<EOF$$" >> "$GITHUB_ENV"
152
+ printf '%s\n\n' "$annotation_title" >> "$GITHUB_ENV"
153
153
  echo "$annotation" | tail -n +2 | \
154
- perl -pe 'BEGIN{undef $/;} s/\n\* (Mon|Tue|Wed|Thu|Fri|Sat|Sun) .*?\n//smg;' > /tmp/annotation.body
154
+ perl -pe 'BEGIN{undef $/;} s/\n\* (Mon|Tue|Wed|Thu|Fri|Sat|Sun) .*?\n//smg;' >> "$GITHUB_ENV"
155
+ echo "EOF$$" >> "$GITHUB_ENV"
155
156
 
156
157
  - name: Create Release
157
- uses: actions/create-release@v1
158
158
  id: create_release
159
159
  env:
160
160
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
161
- with:
162
- tag_name: ${{ github.ref }}
163
- release_name: ${{ steps.tag-check.outputs.annotation_title }}
164
- body_path: /tmp/annotation.body
165
- prerelease: ${{ steps.tag-check.outputs.prerelease == 'yes'}}
166
- draft: false
161
+ IS_PRERELEASE: ${{ steps.tag-check.outputs.prerelease }}
162
+ run: |
163
+ echo "${RELEASE_MESSAGE}" > /tmp/.commit-msg.txt
164
+ args=(--file /tmp/.commit-msg.txt)
165
+ [[ $IS_PRERELEASE == yes ]] && args+=(--prerelease)
166
+
167
+ hub release create ${args[@]} "$TARGET_TAG"
167
168
 
168
169
  deploy-rubygem:
169
170
  name: Deploy RubyGem Release
@@ -177,13 +178,13 @@ jobs:
177
178
  PKG_DIR: ${{ needs.releng-checks.outputs.pkg_dir }}
178
179
  steps:
179
180
  - name: Checkout code
180
- uses: actions/checkout@v2
181
+ uses: actions/checkout@v3
181
182
  with:
182
183
  ref: ${{ github.ref }}
183
184
  clean: true
184
185
  - uses: ruby/setup-ruby@v1
185
186
  with:
186
- ruby-version: 2.5
187
+ ruby-version: 2.7
187
188
  bundler-cache: true
188
189
  - name: Build RubyGem
189
190
  run: |
data/.gitlab-ci.yml CHANGED
@@ -25,7 +25,7 @@ variables:
25
25
  # anchors. If it is still `UNDEFINED`, all the other setting from the job's
26
26
  # anchor are also missing.
27
27
  PUPPET_VERSION: 'UNDEFINED' # <- Matrixed jobs MUST override this (or fail)
28
- BUNDLER_VERSION: '1.17.1'
28
+ BUNDLER_VERSION: '2.2.19'
29
29
  SIMP_MATRIX_LEVEL: '1'
30
30
  SIMP_FORCE_RUN_MATRIX: 'no'
31
31
 
@@ -37,22 +37,24 @@ variables:
37
37
  BUNDLE_BIN: .vendor/gem_install/bin
38
38
  BUNDLE_NO_PRUNE: 'true'
39
39
 
40
+ .snippets:
41
+ before_beaker_google:
42
+ # Logic for beaker-google environments
43
+ - echo -e "\e[0Ksection_start:`date +%s`:before_script05[collapsed=true]\r\e[0KGCP environment checks"
44
+ - "if [ \"$BEAKER_HYPERVISOR\" == google ]; then mkdir -p ~/.ssh; chmod 700 ~/.ssh; test -f ~/.ssh/google_compute_engine || ssh-keygen -f ~/.ssh/google_compute_engine < /dev/null; echo 'gem \"beaker-google\"' >> Gemfile.local ; fi"
45
+ - echo -e "\e[0Ksection_end:`date +%s`:before_script05\r\e[0K"
40
46
 
41
- # bundler dependencies + caching, optional RVM setup, with diagnostic output
42
- # --------------------------------------------------------------------------
43
- .setup_bundler_env: &setup_bundler_env
44
- cache:
45
- # Cache bundler gems between pipelines for each Ruby version
46
- key: "${CI_PROJECT_NAMESPACE}_ruby-${MATRIX_RUBY_VERSION}_bundler"
47
- paths:
48
- - '.vendor'
49
- before_script:
50
- - 'ruby -e "puts %(\n\n), %q(=)*80, %(\nSIMP-relevant Environment Variables:\n\n#{e=ENV.keys.grep(/^PUPPET|^SIMP|^BEAKER|MATRIX/); pad=e.map{|x| x.size}.max+1; e.map{|v| %( * #{%(#{v}:).ljust(pad)} #{39.chr + ENV[v] + 39.chr}\n)}.join}\n), %q(=)*80, %(\n\n)"'
47
+ before:
48
+ # Print important environment variables that may affect this job
49
+ - 'ruby -e "puts %(\n\n), %q(=)*80, %(\nSIMP-relevant Environment Variables:\n\n#{e=ENV.keys.grep(/^PUPPET|^SIMP|^BEAKER|MATRIX|GOOGLE/); pad=((e.map{|x| x.size}.max||0)+1); e.map{|v| %( * #{%(#{v}:).ljust(pad)} #{39.chr + ENV[v] + 39.chr}\n)}.join}\n), %q(=)*80, %(\n\n)" || :'
50
+
51
+ - echo -e "\e[0Ksection_start:`date +%s`:before_script10[collapsed=true]\r\e[0KDiagnostic ruby & gem information"
51
52
  # Diagnostic ruby & gem information
52
53
  - 'which ruby && ruby --version || :'
53
54
  - "[[ $- == *i* ]] && echo 'Interactive shell session' || echo 'Non-interactive shell session'"
54
55
  - "shopt -q login_shell && echo 'Login shell' || echo 'Not a login shell'"
55
56
  - 'rvm ls || :'
57
+ - echo -e "\e[0Ksection_end:`date +%s`:before_script10\r\e[0K"
56
58
 
57
59
  # If RVM is available, make SURE it's using the right Ruby:
58
60
  # * Source rvm (to run in non-login shells)
@@ -64,22 +66,40 @@ variables:
64
66
  - "command -v rvm && { LATEST_RVM_RUBY_XY=\"$(rvm ls | grep \"$MATRIX_RUBY_VERSION\" | tail -1 | sed -e 's/^.*\\([0-9]\\+\\.[0-9]\\+\\.[0-9]\\+\\).*$/\\1/g')\"; if [ -z \"$LATEST_RVM_RUBY_XY\" ]; then LATEST_RVM_RUBY_XY=\"${MATRIX_RUBY_VERSION}-head\"; rvm install \"$LATEST_RVM_RUBY\" --no-docs; else echo \"Found RVM Ruby: '${LATEST_RVM_RUBY_XY}'\"; fi; rvm use \"$LATEST_RVM_RUBY_XY\" ; }"
65
67
  - 'ruby --version || :'
66
68
  - 'gem list sync || :'
69
+ - echo -e "\e[0Ksection_end:`date +%s`:before_script20\r\e[0K"
67
70
 
68
71
  # Bundle gems (preferring cached > local > downloaded resources)
69
72
  # * Try to use cached and local resources before downloading dependencies
70
- - 'declare GEM_BUNDLER_VER=(-v "~> ${BUNDLER_VERSION:-1.17.1}")'
73
+ - echo -e "\e[0Ksection_start:`date +%s`:before_script30[collapsed=true]\r\e[0KBundle gems (preferring cached > local > downloaded resources)"
74
+ - 'declare GEM_BUNDLER_VER=(-v "~> ${BUNDLER_VERSION:-2.2.6}")'
71
75
  - 'declare GEM_INSTALL_CMD=(gem install --no-document)'
72
76
  - 'declare BUNDLER_INSTALL_CMD=(bundle install --no-binstubs --jobs $(nproc) "${FLAGS[@]}")'
73
77
  - 'mkdir -p ${GEM_HOME} ${BUNDLER_BIN}'
74
78
  - 'gem list -ie "${GEM_BUNDLER_VER[@]}" --silent bundler || "${GEM_INSTALL_CMD[@]}" --local "${GEM_BUNDLER_VER[@]}" bundler || "${GEM_INSTALL_CMD[@]}" "${GEM_BUNDLER_VER[@]}" bundler'
75
79
  - 'rm -rf pkg/ || :'
76
80
  - 'bundle check || rm -f Gemfile.lock && ("${BUNDLER_INSTALL_CMD[@]}" --local || "${BUNDLER_INSTALL_CMD[@]}" || bundle pristine || "${BUNDLER_INSTALL_CMD[@]}") || { echo "PIPELINE: Bundler could not install everything (see log output above)" && exit 99 ; }'
81
+ - echo -e "\e[0Ksection_end:`date +%s`:before_script30\r\e[0K"
77
82
 
78
83
  # Diagnostic bundler, ruby, and gem checks:
84
+ - echo -e "\e[0Ksection_start:`date +%s`:before_script40[collapsed=true]\r\e[0KDiagnostic bundler, ruby, and gem checks"
79
85
  - 'bundle exec rvm ls || :'
80
86
  - 'bundle exec which ruby || :'
81
87
  - 'bundle show sync || :'
82
88
  - 'bundle exec gem list sync || :'
89
+ - echo -e "\e[0Ksection_end:`date +%s`:before_script40\r\e[0K"
90
+
91
+ # bundler dependencies and caching
92
+ #
93
+ # - Cache bundler gems between pipelines foreach Ruby version
94
+ # - Try to use cached and local resources before downloading dependencies
95
+ # --------------------------------------
96
+ .setup_bundler_env: &setup_bundler_env
97
+ cache:
98
+ key: "${CI_PROJECT_NAMESPACE}_ruby-${MATRIX_RUBY_VERSION}_bundler"
99
+ paths:
100
+ - '.vendor'
101
+ before_script:
102
+ !reference [.snippets, before]
83
103
 
84
104
 
85
105
  # Assign a matrix level when your test will run. Heavier jobs get higher numbers
@@ -219,7 +239,7 @@ variables:
219
239
  .pup_6_pe: &pup_6_pe
220
240
  image: 'ruby:2.5'
221
241
  variables:
222
- PUPPET_VERSION: '6.18.0'
242
+ PUPPET_VERSION: '6.22.1'
223
243
  BEAKER_PUPPET_COLLECTION: 'puppet6'
224
244
  MATRIX_RUBY_VERSION: '2.5'
225
245
 
@@ -250,17 +270,27 @@ variables:
250
270
  script:
251
271
  - 'bundle exec rake spec'
252
272
 
273
+ .beaker: &beaker
274
+ image: ruby:2.7.2 # must be 2.7.2 if running in GCP
275
+ tags:
276
+ - beaker
277
+ before_script:
278
+ - !reference [.snippets, before_beaker_google]
279
+ - !reference [.snippets, before]
280
+
281
+
282
+
253
283
  .acceptance_base: &acceptance_base
254
284
  stage: 'acceptance'
255
- tags: ['beaker']
256
285
  <<: *setup_bundler_env
257
286
  <<: *with_SIMP_ACCEPTANCE_MATRIX_LEVEL_1
287
+ <<: *beaker
258
288
 
259
289
  .compliance_base: &compliance_base
260
290
  stage: 'compliance'
261
- tags: ['beaker']
262
291
  <<: *setup_bundler_env
263
292
  <<: *with_SIMP_ACCEPTANCE_MATRIX_LEVEL_1
293
+ <<: *beaker
264
294
 
265
295
 
266
296
  # Unit Tests