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: ...@@ -33,7 +33,7 @@ test:
- dockerd - dockerd
script: script:
- docker run --rm its-registry.unl.edu/unl-its/docker-ci/static-code-analysis sonar-scanner -v - 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: Push to Container Registry:
after_script: after_script:
......
...@@ -15,7 +15,7 @@ LABEL org.label-schema.build-date=$BUILD_DATE \ ...@@ -15,7 +15,7 @@ LABEL org.label-schema.build-date=$BUILD_DATE \
WORKDIR /work WORKDIR /work
RUN apk update && apk upgrade && \ RUN apk update && apk upgrade && \
apk add --no-cache git && \ apk add --no-cache git jq && \
pip install detect-secrets pip install detect-secrets
COPY entrypoint.sh /usr/local/bin/ COPY entrypoint.sh /usr/local/bin/
......
#!/bin/sh #!/bin/sh
set -e set -e
PARAM=${2:-scan}
/usr/local/bin/detect-secrets ${PARAM} while [ -n "$1" ]; do
exit $? 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