Skip to content
Snippets Groups Projects
Commit 62d94da7 authored by Philipp Hahn's avatar Philipp Hahn
Browse files

refactor: drop use-less use of cat

parent b7090db6
No related branches found
No related tags found
No related merge requests found
...@@ -265,7 +265,7 @@ create-release: ...@@ -265,7 +265,7 @@ create-release:
- export AVAILABLE_OPENTOFU_VERSIONS - export AVAILABLE_OPENTOFU_VERSIONS
- 'AVAILABLE_IMAGES=$(cat image*.md | sort -r | tee images.md | sed -E "s/(\(digest: .*\))/\n - \1/")' - 'AVAILABLE_IMAGES=$(cat image*.md | sort -r | tee images.md | sed -E "s/(\(digest: .*\))/\n - \1/")'
- export AVAILABLE_IMAGES - export AVAILABLE_IMAGES
- cat .gitlab/release-notes.md.template | envsubst > release-notes.md - envsubst < .gitlab/release-notes.md.template > release-notes.md
artifacts: artifacts:
paths: paths:
- images.md - images.md
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# Regex from https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string # Regex from https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
SEMANTIC_VERSION_REGEX='^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$' SEMANTIC_VERSION_REGEX='^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'
match=$(cat - | perl -ne "print if /$SEMANTIC_VERSION_REGEX/") match=$(perl -ne "print if /$SEMANTIC_VERSION_REGEX/")
if [ -z "$match" ]; then if [ -z "$match" ]; then
echo "The given version doesn't match the semantic versioning format." echo "The given version doesn't match the semantic versioning format."
......
...@@ -132,7 +132,7 @@ gitlab-tofu-init-without-reconfigure: ...@@ -132,7 +132,7 @@ gitlab-tofu-init-without-reconfigure:
- gitlab-tofu init -no-color >/tmp/output.txt 2>&1 || FAILED=true - gitlab-tofu init -no-color >/tmp/output.txt 2>&1 || FAILED=true
- cat /tmp/output.txt - cat /tmp/output.txt
- test $FAILED = true - test $FAILED = true
- 'cat /tmp/output.txt | grep "Error: Backend configuration changed"' - 'grep "Error: Backend configuration changed" /tmp/output.txt'
gitlab-tofu-init-with-reconfigure: gitlab-tofu-init-with-reconfigure:
extends: extends:
...@@ -306,7 +306,7 @@ gitlab-tofu-without-implicit-init: ...@@ -306,7 +306,7 @@ gitlab-tofu-without-implicit-init:
- gitlab-tofu $CMD -no-color >/tmp/output.txt 2>&1 || FAILED=true - gitlab-tofu $CMD -no-color >/tmp/output.txt 2>&1 || FAILED=true
- cat /tmp/output.txt - cat /tmp/output.txt
- test $FAILED = true - test $FAILED = true
- 'cat /tmp/output.txt | grep "$ERROR"' - 'grep "$ERROR" /tmp/output.txt'
parallel: parallel:
matrix: matrix:
- CMD: apply - CMD: apply
...@@ -333,4 +333,4 @@ gitlab-tofu-no-wrapper: ...@@ -333,4 +333,4 @@ gitlab-tofu-no-wrapper:
- gitlab-tofu -- apply -no-color >/tmp/output.txt 2>&1 || FAILED=true - gitlab-tofu -- apply -no-color >/tmp/output.txt 2>&1 || FAILED=true
- cat /tmp/output.txt - cat /tmp/output.txt
- test $FAILED = true - test $FAILED = true
- 'cat /tmp/output.txt | grep "Error: Backend initialization required, please run \"tofu init\""' - 'grep "Error: Backend initialization required, please run \"tofu init\"" /tmp/output.txt'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment