forked from arminc/clair-local-scan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
42 lines (33 loc) · 1.33 KB
/
.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
38
39
40
41
42
sudo: required
language: minimal
services:
- docker
env:
- POSTGRES_IMAGE=postgres:11.1-alpine CLAIR_VERSION=v2.1.0 CLAIR_LOCAL_SCAN_IMAGE=arminc/clair-local-scan
install:
- docker build -t $CLAIR_LOCAL_SCAN_IMAGE --build-arg VERSION=$CLAIR_VERSION clair
before_script:
- docker pull $POSTGRES_IMAGE
- docker run -d --name postgres -e 'PGDATA=/var/lib/postgresql/clair' -e POSTGRES_PASSWORD=password $POSTGRES_IMAGE
- until docker run --rm -it --link postgres:postgres -e PGPASSWORD=password $POSTGRES_IMAGE pg_isready -U postgres -h postgres; do sleep 1; done
- docker run -d --name clair --link postgres:postgres $CLAIR_LOCAL_SCAN_IMAGE
script:
- ./check.sh
after_success:
- docker stop clair
- docker stop postgres
- docker commit postgres arminc/clair-db:$(date +%Y-%m-%d)
- docker tag arminc/clair-db:$(date +%Y-%m-%d) arminc/clair-db:latest
- docker tag $CLAIR_LOCAL_SCAN_IMAGE ${CLAIR_LOCAL_SCAN_IMAGE}:${CLAIR_VERSION}_${TRAVIS_COMMIT}
- docker images
before_deploy:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
deploy:
provider: script
on:
branch: master
script:
docker push ${CLAIR_LOCAL_SCAN_IMAGE}:${CLAIR_VERSION}_${TRAVIS_COMMIT} &&
docker push $CLAIR_LOCAL_SCAN_IMAGE:latest &&
docker push arminc/clair-db:$(date +%Y-%m-%d) &&
docker push arminc/clair-db:latest