All checks were successful
ci/woodpecker/push/dockerhub Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test/1 Pipeline was successful
ci/woodpecker/push/test/2 Pipeline was successful
ci/woodpecker/manual/dockerhub Pipeline was successful
ci/woodpecker/manual/lint Pipeline was successful
ci/woodpecker/manual/build Pipeline was successful
ci/woodpecker/manual/test/1 Pipeline was successful
ci/woodpecker/manual/test/2 Pipeline was successful
41 lines
777 B
Bash
Executable file
41 lines
777 B
Bash
Executable file
#!/bin/bash
|
|
set -eu;
|
|
|
|
##
|
|
## check if any yaml file is present
|
|
##
|
|
|
|
FILES=$(find "$(pwd)" -type f -name '*.yml' -o -name '*.yaml')
|
|
if [[ ! "$FILES" ]]; then
|
|
echo "No yaml file found!"
|
|
exit 1
|
|
fi
|
|
|
|
##
|
|
## build command
|
|
##
|
|
|
|
COMMAND="yamllint"
|
|
if [[ -n "${PLUGIN_CONFIG_FILE:-}" ]]; then
|
|
COMMAND+=" --config-file=$PLUGIN_CONFIG"
|
|
fi
|
|
COMMAND+=" --format=${PLUGIN_FORMAT:-colored}"
|
|
if [[ "${PLUGIN_STRICT:-true}" == "true" ]]; then
|
|
COMMAND+=" --strict"
|
|
fi
|
|
if [[ "${PLUGIN_NO_WARNINGS:-}" == "true" ]]; then
|
|
COMMAND+=" --no-warnings"
|
|
fi
|
|
COMMAND+=" $(pwd)"
|
|
|
|
# custom args, e.g. docker run --rm --volume=$(pwd):$(pwd) --workdir=$(pwd) --env=CI=test kokuwaio/yamllint --format=json
|
|
if [[ -n "${1:-}" ]]; then
|
|
COMMAND+=" $*"
|
|
fi
|
|
|
|
##
|
|
## execute command
|
|
##
|
|
|
|
echo "$COMMAND"
|
|
eval "$COMMAND"
|