Skip to content

Commit

Permalink
Skip docker build in case --image arg is defined (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabasoad authored Nov 11, 2021
1 parent 7a0afb6 commit 7010ada
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hooks/snyk-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ set -eu
SCRIPT_DIR="$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)"
bash "${SCRIPT_DIR}"/_check-installation.sh

image="snyk-container-test:$(date +%s)"
for i in "$@"; do
case $i in
-i=*|--image=*)
Expand All @@ -15,5 +14,10 @@ for i in "$@"; do
esac
done

docker build -t "${image}" .
if [ -z "${image:-}" ]
then
image="snyk-container-test:$(date +%s)"
docker build -t "${image}" .
fi

snyk container test "${image}" "$@"

0 comments on commit 7010ada

Please sign in to comment.