-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit(.travis.yml)
37 lines (26 loc) · 1.25 KB
/
git(.travis.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
language: generic
services:
- docker
before_script:
# Install Trivy
- wget https://github.com/aquasecurity/trivy/releases/latest/download/trivy_0.56.2_Linux-64bit.deb
- sudo dpkg -i trivy_0.56.2_Linux-64bit.deb
script:
# Build Docker image
- docker build -t trivy-travis:latest .
# Scan Docker image with Trivy and save the report in txt format
- trivy image --exit-code 1 --severity HIGH,CRITICAL --format table -o trivy-report.txt trivy-travis:latest || true
after_script:
# Configure git
- git config --global user.email "[email protected]"
- git config --global user.name "kumar-axxonet"
# Checkout the branch for reports, create if it doesn't exist
- git checkout -b trivy-travis-reports || git checkout trivy-travis-reports
# Add and commit the Trivy report
- git add trivy-report.txt
- git commit -m "Add Trivy scan report on $(date +'%Y-%m-%d')"
# Push to the repository using the GITHUB_TOKEN
- git push https://[email protected]/eHealthAfrica/trivy-travis.git trivy-travis-reports
#language: generic: Specifies a generic environment , for Docker
#services: docker: enables Docker within the Travis CI environment.
#before_script: Installs Trivy on the Travis CI environment