Skip to content

Commit

Permalink
(SIMP-9408) GLCI & GHA release workflow fixes (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
op-ct authored Mar 2, 2021
1 parent 4651d5e commit a56c341
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr_glci_cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# NOTICE: **This file is maintained with puppetsync**
#
# This file is updated automatically as part of a puppet module baseline.
# This file is updated automatically as part of a standardized asset baseline.
#
# The next baseline sync will overwrite any local changes to this file!
#
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_glci_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# NOTICE: **This file is maintained with puppetsync**
#
# This file is updated automatically as part of a puppet module baseline.
# This file is updated automatically as part of a standardized asset baseline.
#
# The next baseline sync will overwrite any local changes to this file!
#
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ jobs:
with:
ruby-version: ${{matrix.puppet.ruby_version}}
bundler-cache: true
- run: 'command -v rpm || if command -v apt-get; then apt-get update; apt-get install -y rpm; fi ||:'
- run: 'command -v rpm || if command -v apt-get; then sudo apt-get update; sudo apt-get install -y rpm; fi ||:'
- run: 'bundle exec rake spec'

# dump_contexts:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tag_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ env:
jobs:
releng-checks:
name: "RELENG checks"
if: github.repository_owner == 'simp'
runs-on: ubuntu-18.04
steps:
- name: "Assert '${{ github.ref }}' is a tag"
Expand All @@ -57,6 +58,7 @@ jobs:
create-github-release:
name: Deploy GitHub Release
needs: [ releng-checks ]
if: github.repository_owner == 'simp'
runs-on: ubuntu-18.04
steps:
- name: Checkout code
Expand Down Expand Up @@ -100,6 +102,7 @@ jobs:
deploy-to-puppet-forge:
name: Deploy PuppetForge Release
needs: [ releng-checks ]
if: github.repository_owner == 'simp'
runs-on: ubuntu-18.04
env:
PUPPETFORGE_API_TOKEN: ${{ secrets.PUPPETFORGE_API_TOKEN }}
Expand Down
12 changes: 5 additions & 7 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ variables:
- '.vendor'
before_script:
# Print important environment variables that may affect this job
- '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||0)+1); e.map{|v| %( * #{%(#{v}:).ljust(pad)} #{39.chr + ENV[v] + 39.chr}\n)}.join}\n), %q(=)*80, %(\n\n)"'
- '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||0)+1); e.map{|v| %( * #{%(#{v}:).ljust(pad)} #{39.chr + ENV[v] + 39.chr}\n)}.join}\n), %q(=)*80, %(\n\n)" || :'

- echo -e "\e[0Ksection_start:`date +%s`:before_script10[collapsed=true]\r\e[0KDiagnostic ruby & gem information"
# Diagnostic ruby & gem information
Expand All @@ -69,13 +69,11 @@ variables:

# If RVM is available, make SURE it's using the right Ruby:
# * Source rvm (to run in non-login shells)
# * If any $MATRIX_RUBY_VERSION rubies are available, use the latest
# * Otherwise: install & use ${MATRIX_RUBY_VERSION}-head (e.g., latest)
# * ^^ This could be wonky and introduce variations across runners
# * ^^ maybe it should just fail if there is no $MATRIX_RUBY_VERSION installed?
# * Use $MATRIX_RUBY_VERSION ruby, install if not present
- echo -e "\e[0Ksection_start:`date +%s`:before_script20[collapsed=true]\r\e[0KEnsure RVM & ruby is installed"
- "command -v rvm && { if declare -p rvm_path &> /dev/null; then source \"${rvm_path}/scripts/rvm\"; else source \"$HOME/.rvm/scripts/rvm\" || source /etc/profile.d/rvm.sh; fi; }"
- "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\" ; }"
- "if command -v rvm; then if declare -p rvm_path &> /dev/null; then source \"${rvm_path}/scripts/rvm\"; else source \"$HOME/.rvm/scripts/rvm\" || source /etc/profile.d/rvm.sh; fi; fi"
- "if command -v rvm && ! grep rvm_install_on_use_flag=1 ~/.rvmrc; then echo rvm_install_on_use_flag=1 >> ~/.rvmrc || echo '== WARNING: ~/.rvmrc is missing rvm_install_on_use_flag=1 and I failed to add it'; fi"
- "if command -v rvm; then rvm use \"$MATRIX_RUBY_VERSION\"; else echo \"rvm not detected; skipping 'rvm use'\"; fi"
- 'ruby --version || :'
- 'gem list sync || :'
- echo -e "\e[0Ksection_end:`date +%s`:before_script20\r\e[0K"
Expand Down

0 comments on commit a56c341

Please sign in to comment.