Skip to content

Commit

Permalink
ci(kitchen+ci): update with latest 3003.2 pre-salted images [skip ci]
Browse files Browse the repository at this point in the history
* Automated using myii/ssf-formula#360
  • Loading branch information
myii committed Aug 19, 2021
1 parent 3211753 commit d9a364f
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# `image`
image_commitlint: &image_commitlint 'myii/ssf-commitlint:11'
image_dindruby: &image_dindruby 'myii/ssf-dind-ruby:2.7.1-r3'
image_dindrubybionic: &image_dindrubybionic 'myii/ssf-dind-ruby-bionic:2.7.1-1bbox1'
image_dindrubybionic: &image_dindrubybionic 'myii/ssf-dind-ruby-bionic:1_2.5.1'
image_precommit: &image_precommit
name: 'myii/ssf-pre-commit:2.9.2'
entrypoint: ['/bin/bash', '-c']
Expand Down Expand Up @@ -142,9 +142,7 @@ rubocop:
# TODO: This should work from the env vars above automatically
- 'bundle config set path "${BUNDLE_CACHE_PATH}"'
- 'bundle config set without "${BUNDLE_WITHOUT}"'
- 'bundle update --bundler --conservative'
- 'bundle binstubs bundler --force'
- 'PATH=./bin:"$PATH" bundle install'
- 'bundle install'
script:
- 'bin/kitchen verify default-debian-11-master-py3'
# REMOVEME>
Expand Down
88 changes: 88 additions & 0 deletions pre-commit_semantic-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,91 @@ sed -i -e '1,4s/-/=/g' CHANGELOG.rst

# Return back to the main directory
cd ..


###############################################################################
# (C) Make all adjustments related to the Antora-based documentation
# This needs to run after the conversion to `.rst` since it uses
# those files to convert to `.adoc`
###############################################################################

# Update `docs/antora.yml` with `${nextRelease.version}`
sed -i -e "/^\(version: '\).*\('\)$/s//\1${1}\2/" docs/antora.yml

# Convert the files from `.rst` to `.adoc` using `pandoc`
FROM=rst && FN=CHANGELOG && pandoc -t asciidoctor -f ${FROM} -o docs/modules/ROOT/pages/${FN}.adoc docs/${FN}.${FROM}
FROM=rst && FN=AUTHORS && pandoc -t asciidoctor -f ${FROM} -o docs/modules/ROOT/pages/${FN}.adoc docs/${FN}.${FROM}
FROM=rst && FN=README && pandoc -t asciidoctor -f ${FROM} -o docs/modules/ROOT/pages/${FN}.adoc docs/${FN}.${FROM}

# Adjust `CHANGELOG.adoc`
ADOC="docs/modules/ROOT/pages/CHANGELOG.adoc"
# Fix links to avoid issue with `...` in URL
# Also ensure each of these links opens in a new tab
sed -i -e '/^\(=== \)\(https.*\)\(\[.*\)\(]\)/s//\1link:++\2++\3^\4/' "${ADOC}"
# Open other standard links in new tabs
sed -i -e '/^\((https.*\)\(]\)/s//\1^\2/' "${ADOC}"
sed -i -e '/^\(https.*\)\(]\)/s//\1^\2/' "${ADOC}"
# And other non-standard links
# shellcheck disable=SC2016
sed -i -e '\_^\((https.*/commit/\)\(.......\)\()\)$_s__\1\2[\2^]\3_' "${ADOC}"
# Fix headings throughout file
sed -i -e '/^=/s///' "${ADOC}"
# Fix `[skip ci]` on line by itself
sed -i -e '/^\[skip ci]$/s// &/' "${ADOC}"
# Fix what looks like Asciidoctor variables, i.e. in curly braces `{...}`
sed -i -e '/{\w\+}/s//\\&/' "${ADOC}"
# Add `:sectnums!:` directly after the title (the blank line in-between is necessary)
sed -i -e '2 i \\n:sectnums!:' "${ADOC}"

# Adjust `AUTHORS.adoc`
ADOC="docs/modules/ROOT/pages/AUTHORS.adoc"
# Fix the heading
sed -i -e '/^=/s///' "${ADOC}"
# Run three times to get all four lines joined
# (most entries only need two joins but that's dealt with below)
sed -i -e '/^|:raw-html-m2r/N;s/\n/ /' "${ADOC}"
sed -i -e '/^|:raw-html-m2r/N;s/\n/ /' "${ADOC}"
sed -i -e '/^|:raw-html-m2r/N;s/\n/ /' "${ADOC}"
# Add blank line in-between
sed -i -e '/^|:raw-html-m2r/{G;}' "${ADOC}"
# Clear up any double-blank lines introduced
sed -i -e '/^$/N;/\n$/D' "${ADOC}"
# Split the lines again on the table delimeter
sed -i -e '/^|:raw-html-m2r/s/ |/\n|/g' "${ADOC}"
# Fix the `raw-html-m2r` to link to the GitHub avatar images correctly
sed -i -e "/^\(|\):raw-html-m2r.*src='\(.*\)' width='\(.*\)' height='\(.*\)' alt='\(.*\)'.*/s//\1image::\2[\5,\3,\4]/" "${ADOC}"
# Reduce the table boundary markers
sed -i -e '/^|===.*/s//|===/' "${ADOC}"
# Reduce the table boundary markers
sed -i -e '/^|Avatar |Contributor |Contributions/s//^.^|Avatar\n<.^|Contributor\n^.^|Contributions\n/' "${ADOC}"
# Fix the table heading
sed -i -e '/^\[cols=".*/s//.List of contributors\n[format="psv", separator="|", options="header", cols="^.<30a,<.<40a,^.<40d", width="100"]/' "${ADOC}"
# Open links in new tab
sed -i -e '/^\(|https.*\)\(]\)/s//\1^\2/' "${ADOC}"
# Likewise for footer links
sed -i -e '/\(\[forked version\)\(]\)/s//\1^\2/' "${ADOC}"
sed -i -e '/\(\[.*maintainer\)\(]\)/s//\1^\2/' "${ADOC}"

# Adjust `README.adoc`
ADOC="docs/modules/ROOT/pages/README.adoc"
# Fix headings throughout file
sed -i -e '/^=/s///' "${ADOC}"
# Delete the `[[readme]]` line
sed -i -e '/^\[\[readme]]$/d' "${ADOC}"
# Remove the `Table of Contents` line and the blank line after it
sed -i -e '/^\*Table of Contents\*$/,+1d' "${ADOC}"
# Fix the link to `CONTRIBUTING.adoc` (to the Antora-based version)
# shellcheck disable=SC2016
sed -i -e '/^Please see `How to contribute <CONTRIBUTING>` for more details.$/s//Please see\nxref:main::CONTRIBUTING.adoc[How to contribute]\nfor more details./' "${ADOC}"
# Fix the link to `CONTRIBUTING.adoc` (to the Antora-based version) -- based on `.github` repo
sed -i -e '\_https://github.com/saltstack-formulas/.github/blob/master/CONTRIBUTING.rst_s__xref:main::CONTRIBUTING.adoc_' "${ADOC}"
# Fix the link to `map.jinja.adoc` (to the Antora-based version)
sed -i -e '/^\* link:map.jinja.rst/s//* xref:main::map.jinja.adoc/' "${ADOC}"
# Fix link: `#_special_notes`
sed -i -e '/#special-notes/s//#_special_notes/' "${ADOC}"
# Fix `sourceCode`
sed -i -e '/^\(\[source,\)sourceCode,/s//\1/' "${ADOC}"
# Fix source `jinja2`
sed -i -e '/^\(\[source,jinja\)2/s//\1/' "${ADOC}"
# Fix source `sls`
sed -i -e '/^\(\[source,\)sls/s//\1yaml/' "${ADOC}"

0 comments on commit d9a364f

Please sign in to comment.