-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix hack scripts to run locally again
Fix hack scripts to run locally again. We have some Git permissions issues, formatting issues, deprecated linters, bad Go configs, custom mount points etc. Now it should be cleaner, runs on Linux and Mac equally (zsh can't handle "${@}" for example)... Signed-off-by: Tuomo Tanskanen <[email protected]>
- Loading branch information
Showing
7 changed files
with
63 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
#!/bin/sh | ||
# markdownlint-cli2 has config file(s) named .markdownlint-cli2.yaml in the repo | ||
# shellcheck disable=SC2292 | ||
|
||
set -eux | ||
|
||
IS_CONTAINER="${IS_CONTAINER:-false}" | ||
CONTAINER_RUNTIME="${CONTAINER_RUNTIME:-podman}" | ||
WORKDIR="${WORKDIR:-/workdir}" | ||
|
||
# all md files, but ignore .github | ||
if [ "${IS_CONTAINER}" != "false" ]; then | ||
markdownlint-cli2 "**/*.md" "#.github" | ||
else | ||
"${CONTAINER_RUNTIME}" run --rm \ | ||
--env IS_CONTAINER=TRUE \ | ||
--volume "${PWD}:/workdir:ro,z" \ | ||
--volume "${PWD}:${WORKDIR}:ro,z" \ | ||
--entrypoint sh \ | ||
--workdir /workdir \ | ||
--workdir "${WORKDIR}" \ | ||
docker.io/pipelinecomponents/markdownlint-cli2:0.9.0@sha256:71370df6c967bae548b0bfd0ae313ddf44bfad87da76f88180eff55c6264098c \ | ||
/workdir/hack/markdownlint.sh "$@" | ||
"${WORKDIR}"/hack/markdownlint.sh "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
#!/bin/sh | ||
# shellcheck disable=SC2292 | ||
|
||
set -eux | ||
|
||
IS_CONTAINER=${IS_CONTAINER:-false} | ||
IS_CONTAINER="${IS_CONTAINER:-false}" | ||
CONTAINER_RUNTIME="${CONTAINER_RUNTIME:-podman}" | ||
WORKDIR="${WORKDIR:-/workdir}" | ||
|
||
if [ "${IS_CONTAINER}" != "false" ]; then | ||
TOP_DIR="${1:-.}" | ||
find "${TOP_DIR}" -path ./vendor -prune -o -name '*.sh' -type f -exec shellcheck -s bash {} \+ | ||
TOP_DIR="${1:-.}" | ||
find "${TOP_DIR}" -path ./vendor -prune -o -name '*.sh' -type f -exec shellcheck -s bash {} \+ | ||
else | ||
"${CONTAINER_RUNTIME}" run --rm \ | ||
--env IS_CONTAINER=TRUE \ | ||
--volume "${PWD}:/workdir:ro,z" \ | ||
--entrypoint sh \ | ||
--workdir /workdir \ | ||
docker.io/koalaman/shellcheck-alpine:v0.10.0@sha256:5921d946dac740cbeec2fb1c898747b6105e585130cc7f0602eec9a10f7ddb63 \ | ||
/workdir/hack/shellcheck.sh "$@" | ||
"${CONTAINER_RUNTIME}" run --rm \ | ||
--env IS_CONTAINER=TRUE \ | ||
--volume "${PWD}:${WORKDIR}:ro,z" \ | ||
--entrypoint sh \ | ||
--workdir "${WORKDIR}" \ | ||
docker.io/koalaman/shellcheck-alpine:v0.10.0@sha256:5921d946dac740cbeec2fb1c898747b6105e585130cc7f0602eec9a10f7ddb63 \ | ||
"${WORKDIR}"/hack/shellcheck.sh "$@" | ||
fi |
This file was deleted.
Oops, something went wrong.