Skip to content

Commit

Permalink
Add container scanning CI job
Browse files Browse the repository at this point in the history
  • Loading branch information
viktigpetterr committed Jan 14, 2023
1 parent 336d4f3 commit e753b04
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/debricked.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ on:
pull_request:

jobs:
vulnerabilities-scan:
scan:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v2
Expand All @@ -27,3 +26,12 @@ jobs:
printf "$(go mod graph)\n\n$(go list -mod=readonly -e -m all)" > .debricked-go-dependencies.txt
- run: |
go run cmd/debricked/main.go scan -t ${{ secrets.DEBRICKED_TOKEN }} -e "**/testdata/**"
docker-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Docker image
run: bash scripts/test_docker.sh cli
- name: Scan Docker image
run: go run cmd/debricked/main.go scan docker debricked/cli:dev -t ${{ secrets.DEBRICKED_TOKEN }}
6 changes: 3 additions & 3 deletions scripts/test_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ type="$1"

case $type in
"dev")
docker build -f build/docker/Dockerfile -t debricked/cli-dev:latest --target dev .
docker build -f build/docker/Dockerfile -t debricked/cli-dev:dev --target dev .
;;
"cli")
docker build -f build/docker/Dockerfile -t debricked/cli:latest --target cli .
docker build -f build/docker/Dockerfile -t debricked/cli:dev --target cli .
;;
"scan")
docker build -f build/docker/Dockerfile -t debricked/cli-scan:latest --target scan .
docker build -f build/docker/Dockerfile -t debricked/cli-scan:dev --target scan .
;;
*)
echo "${type} type is not supported!"
Expand Down

0 comments on commit e753b04

Please sign in to comment.