From dc88b940fe338bf5ac0ed0c6ce4db937bd9262cd Mon Sep 17 00:00:00 2001 From: Maurizio Porrato Date: Sun, 21 Aug 2022 08:59:48 +0100 Subject: [PATCH] Add shellcheck step to lint CI pipeline --- .woodpecker/lint.yml | 6 +++++- run.sh | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.woodpecker/lint.yml b/.woodpecker/lint.yml index 08e4fad..4b005ba 100644 --- a/.woodpecker/lint.yml +++ b/.woodpecker/lint.yml @@ -1,6 +1,10 @@ --- pipeline: + shellcheck: + image: pipelinecomponents/shellcheck + commands: + - find . -name .git -type d -prune -o -type f -name \*.sh -print0 | xargs -0 -r -t -n1 shellcheck hadolint: image: pipelinecomponents/hadolint commands: - - hadolint Dockerfile + - find . -name .git -type d -prune -o -type f \( -name Dockerfile\* -or -name Containerfile\* \) -print0 | xargs -0 -r -t -n1 hadolint diff --git a/run.sh b/run.sh index db39fcb..c49ad30 100755 --- a/run.sh +++ b/run.sh @@ -5,10 +5,12 @@ CA_CERT_FILE="${CERTS_DIR}/ca/cert.pem" CA_KEY_FILE="${CERTS_DIR}/ca/key.pem" mkdir -p "${CERTS_DIR}/ca" -[ -e "${CA_CERT_FILE}" -a -e "${CA_KEY_FILE}" ] || \ +if [ ! -e "${CA_CERT_FILE}" ] || [ ! -e "${CA_KEY_FILE}" ] ; then + rm -f "${CA_CERT_FILE}" "${CA_KEY_FILE}" openssl req -new -newkey rsa:2048 -sha256 -days 1500 -nodes -x509 \ -extensions v3_ca -subj "/C=/ST=/L=/O=/OU=/CN=proxy" \ -keyout "${CA_KEY_FILE}" -out "${CA_CERT_FILE}" +fi mkdir -p /static cp -f "${CA_CERT_FILE}" /static/ca.crt