Skip to content

Commit 584591b

Browse files
gloursgtardif
authored andcommitted
Add installer for docker scan
Signed-off-by: Guillaume Lours <[email protected]>
1 parent 48959a1 commit 584591b

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

plugins/scan.installer

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
source "$(dirname "$0")/.common"
6+
PKG=github.com/docker/scan-cli-plugin
7+
GOPATH=$(go env GOPATH)
8+
REPO=https://${PKG}.git
9+
COMMIT=v0.7.0
10+
DEST=${GOPATH}/src/${PKG}
11+
12+
build() {
13+
if [ ! -d "${DEST}" ]; then
14+
git clone "${REPO}" "${DEST}"
15+
fi
16+
(
17+
cd "${DEST}"
18+
git fetch --all
19+
git checkout -q "${COMMIT}"
20+
PLATFORM_BINARY=docker-scan make native-build
21+
)
22+
}
23+
24+
install_plugin() {
25+
(
26+
cd "${DEST}"
27+
install_binary bin/docker-scan
28+
)
29+
}
30+
31+
build_or_install "$@"

0 commit comments

Comments
 (0)