Skip to content

Commit

Permalink
preflight
Browse files Browse the repository at this point in the history
  • Loading branch information
benmangold committed Sep 1, 2021
1 parent d7116e4 commit 0afce66
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dgoss
goss
snyk
snyk
preflight
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dgoss
goss
snyk
snyk
preflight
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ci: install build-image test

# install testing dependencies
install: install-goss install-dive install-snyk
install: install-preflight install-goss install-dive install-snyk

test: test-goss test-dive test-snyk

Expand All @@ -23,6 +23,8 @@ install-dive:
install-snyk:
./scripts/install-snyk.sh

install-preflight:
./scripts/install-preflight.sh

# commands to run tests and scans on `test` image
test-goss:
Expand Down
13 changes: 10 additions & 3 deletions scripts/install-dive.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#! /bin/bash

curl -L https://github.com/wagoodman/dive/releases/download/v0.9.2/dive_0.9.2_linux_amd64.deb -o dive_0.9.2_linux_amd64.deb
sudo apt install ./dive_0.9.2_linux_amd64.deb
# Dive Debian package installation. MacOSX installs Dive via `brew install dive`.

rm dive_0.9.2_linux_amd64.deb
export CHECKSUM=$(curl -L https://github.com/wagoodman/dive/releases/download/v0.10.0/dive_0.10.0_checksums.txt | grep linux_amd64.deb)

curl -L https://github.com/wagoodman/dive/releases/download/v0.10.0/dive_0.10.0_linux_amd64.deb -o dive_0.10.0_linux_amd64.deb

./preflight check sha256=$CHECKSUM dive_0.10.0_linux_amd64.deb

sudo apt install ./dive_0.10.0_linux_amd64.deb

rm dive_0.10.0_linux_amd64.deb
18 changes: 16 additions & 2 deletions scripts/install-goss.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
#! /bin/bash

curl -L https://raw.githubusercontent.com/aelsabbahy/goss/master/extras/dgoss/dgoss -o dgoss
chmod +rx dgoss
# Goss Binary installation to $PWD

export GOSS_CHECKSUM=$(curl -L https://github.com/aelsabbahy/goss/releases/latest/download/goss-linux-amd64.sha256 | head -n1 | cut -d " " -f1 )

curl -L https://github.com/aelsabbahy/goss/releases/latest/download/goss-linux-amd64 -o goss

./preflight check sha256=$GOSS_CHECKSUM goss

chmod +rx goss

# DGoss Binary installation to $PWD

export DGOSS_CHECKSUM=$(curl -L https://github.com/aelsabbahy/goss/releases/latest/download/dgoss.sha256 | head -n1 | cut -d " " -f1 )

curl -L https://github.com/aelsabbahy/goss/releases/latest/download/dgoss -o dgoss

./preflight check sha256=$DGOSS_CHECKSUM dgoss

chmod +rx dgoss
17 changes: 17 additions & 0 deletions scripts/install-preflight.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#! /bin/bash

# Preflight binary installation to $PWD

mkdir .tmp_preflight

curl -L https://github.com/SpectralOps/preflight/releases/download/v1.1.4/preflight_1.1.4_Linux_arm64.tar.gz -o .tmp_preflight/preflight_1.1.4_Linux_x86_64.tar.gz

cd .tmp_preflight/
tar -xvf preflight_1.1.4_Linux_x86_64.tar.gz
cd ..

cp ./.tmp_preflight/preflight preflight

ls .tmp_preflight

rm -rf .tmp_preflight/
9 changes: 9 additions & 0 deletions scripts/install-snyk.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
#! /bin/bash

# Snyk binary installation to $PWD

export CHECKSUM=$(curl -L https://github.com/snyk/snyk/releases/latest/download/snyk-linux.sha256 | head -n1 | cut -d " " -f1)

curl -L https://github.com/snyk/snyk/releases/latest/download/snyk-linux -o snyk

./preflight check sha256=$CHECKSUM snyk

chmod +rx snyk

0 comments on commit 0afce66

Please sign in to comment.