-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathconfig.yml
41 lines (40 loc) · 1.27 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
version: 2.1
jobs:
build:
docker:
- image: cimg/base:2021.04
steps:
- checkout
- setup_remote_docker
- run:
name: Build trivy-offline Docker image
environment:
_REGISTRY: quay.io
command: |
IMAGE_NAME=$REGISTRY/sighup/trivy-offline
FULL_DATE_TAG=$(date +"%Y-%m-%d")
docker login $_REGISTRY -u $_REGISTRY_USER -p $_REGISTRY_PASSWORD
docker build --pull --no-cache -t $IMAGE_NAME:$FULL_DATE_TAG -t $IMAGE_NAME:latest .
docker push $IMAGE_NAME:$FULL_DATE_TAG
docker push $IMAGE_NAME:latest
test:
docker:
- image: quay.io/sighup/trivy-offline:latest
steps:
- run:
name: Run Aquasec trivy scanner
command: trivy image --exit-code 0 --format json --output trivy-container-scanning-report.json --no-progress --skip-update python:3.4-alpine
- store_artifacts:
path: trivy-container-scanning-report.json
destination: trivy-container-scanning-report
workflows:
build_image_and_test:
jobs:
- build:
filters:
branches:
only:
- circleci-project-setup
- test:
requires:
- build