Skip to content
Snippets Groups Projects
Commit c5b42049 authored by Jose Raul Barreras's avatar Jose Raul Barreras
Browse files

fix detect-secrets/entrypoint.sh exit code

parent d5828fe2
No related branches found
No related tags found
4 merge requests!34develop to master,!18sync dependency-check with secrets-detection,!17Resolve "Add Dependency Check",!16Resolve "Add Automated Secrets Detection"
......@@ -33,7 +33,7 @@ test:
- dockerd
script:
- docker run --rm its-registry.unl.edu/unl-its/docker-ci/static-code-analysis sonar-scanner -v
- docker run --rm -v "${PWD}:/work" -w /work its-registry.unl.edu/unl-its/docker-ci/detect-secrets scan
- docker run --rm -v "${PWD}:/work" -w /work its-registry.unl.edu/unl-its/docker-ci/detect-secrets -s
Push to Container Registry:
after_script:
......
......@@ -15,7 +15,7 @@ LABEL org.label-schema.build-date=$BUILD_DATE \
WORKDIR /work
RUN apk update && apk upgrade && \
apk add --no-cache git && \
apk add --no-cache git jq && \
pip install detect-secrets
COPY entrypoint.sh /usr/local/bin/
......
#!/bin/sh
set -e
PARAM=${2:-scan}
/usr/local/bin/detect-secrets ${PARAM}
exit $?
while [ -n "$1" ]; do
case "$1" in
-s)
RESULT=`/usr/local/bin/detect-secrets scan | jq '.results | length == 0'`
echo ${RESULT}
if [ "${RESULT}" = "true" ]; then
exit 0
else
exit 1
fi
;;
*)
exec /bin/sh
;;
esac
shift
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment