github.com/devseccon/trivy@v0.47.1-0.20231123133102-bd902a0bd996/docs/tutorials/integrations/travis-ci.md (about)

     1  # Travis CI
     2  
     3  ```
     4  $ cat .travis.yml
     5  services:
     6    - docker
     7  
     8  env:
     9    global:
    10      - COMMIT=${TRAVIS_COMMIT::8}
    11  
    12  before_install:
    13    - docker build -t trivy-ci-test:${COMMIT} .
    14    - export VERSION=$(curl --silent "https://api.github.com/repos/devseccon/trivy/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')
    15    - wget https://github.com/devseccon/trivy/releases/download/v${VERSION}/trivy_${VERSION}_Linux-64bit.tar.gz
    16    - tar zxvf trivy_${VERSION}_Linux-64bit.tar.gz
    17  script:
    18    - ./trivy image --exit-code 0 --severity HIGH --no-progress trivy-ci-test:${COMMIT}
    19    - ./trivy image --exit-code 1 --severity CRITICAL --no-progress trivy-ci-test:${COMMIT}
    20  cache:
    21    directories:
    22      - $HOME/.cache/trivy
    23  ```
    24  
    25  [Example][example]
    26  [Repository][repository]
    27  
    28  [example]: https://travis-ci.org/devseccon/trivy-ci-test
    29  [repository]: https://github.com/devseccon/trivy-ci-test