forked from razee-io/WatchKeeper
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
53 lines (48 loc) · 1.56 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
43
44
45
46
47
48
49
50
51
52
53
language: node_js
node_js:
- "11"
services:
- docker
script:
# Audit npm packages. Fail build whan a PR audit fails, otherwise report the vulnerability and proceed.
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then npx audit-ci --low; else npx audit-ci --low || true; fi
- npm run lint
- npm test
- docker build --rm -t "quay.io/razee/watch-keeper:${TRAVIS_COMMIT}" .
- if [ -n "${TRAVIS_TAG}" ]; then docker tag quay.io/razee/watch-keeper:${TRAVIS_COMMIT} quay.io/razee/watch-keeper:${TRAVIS_TAG}; fi
- docker images
- ./build/process-template.sh kubernetes/watch-keeper/resource.yaml >/tmp/resource.yaml
before_deploy:
- docker login -u="${QUAY_ID}" -p="${QUAY_TOKEN}" quay.io
deploy:
# Deploy alpha builds
- provider: script
script: docker push "quay.io/razee/watch-keeper:${TRAVIS_TAG}"
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+_[0-9]{3}$
- provider: releases
file: /tmp/resource.yaml
skip_cleanup: true
draft: true
api_key:
secure: "${GITHUB_TOKEN}"
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+_[0-9]{3}$
# Deploy released builds
- provider: script
script: docker push "quay.io/razee/watch-keeper:${TRAVIS_TAG}"
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+$
- provider: releases
file: /tmp/resource.yaml
skip_cleanup: true
api_key:
secure: "${GITHUB_TOKEN}"
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+$