This repository has been archived by the owner on Sep 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path.travis.yml
163 lines (145 loc) · 6.31 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
language: node_js
node_js:
- "lts/*"
services:
- docker
before_install:
- if [[ -n $DOCKERHUB_TOKEN ]]; then echo "$DOCKERHUB_TOKEN" | docker login -u "icdevops" --password-stdin; fi
env:
global:
- GROUP=deploy.razee.io
- VERSION=v1alpha2
jobs:
include:
- stage: building images
name: building amd64 image
arch: amd64
script:
# Audit npm packages. Fail build whan a PR audit fails, otherwise report the vulnerability and proceed.
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then npm audit; else npm audit || true; fi
- npm run lint
- npm test
- if [[ $TRAVIS_TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then npm version --no-git-tag-version "${TRAVIS_TAG}"; fi
- docker build --rm -t "quay.io/razee/remoteresources3:${TRAVIS_COMMIT}-amd64" .
- if [ -n "${TRAVIS_TAG}" ]; then docker tag quay.io/razee/remoteresources3:${TRAVIS_COMMIT}-amd64 quay.io/razee/remoteresources3:${TRAVIS_TAG}-amd64; fi
- docker images
- ./build/process-template.sh kubernetes/RemoteResourceS3/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/remoteresources3:${TRAVIS_TAG}-amd64"
skip_cleanup: true
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/remoteresources3:${TRAVIS_TAG}-amd64"
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+$
- name: building ppc64le image
arch: ppc64le
script:
# Audit npm packages. Fail build whan a PR audit fails, otherwise report the vulnerability and proceed.
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then npm audit; else npm audit || true; fi
- npm test
- if [[ $TRAVIS_TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then npm version --no-git-tag-version "${TRAVIS_TAG}"; fi
- docker build --rm -t "quay.io/razee/remoteresources3:${TRAVIS_COMMIT}-ppc64le" .
- if [ -n "${TRAVIS_TAG}" ]; then docker tag quay.io/razee/remoteresources3:${TRAVIS_COMMIT}-ppc64le quay.io/razee/remoteresources3:${TRAVIS_TAG}-ppc64le; fi
- docker images
- ./build/process-template.sh kubernetes/RemoteResourceS3/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/remoteresources3:${TRAVIS_TAG}-ppc64le"
skip_cleanup: true
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/remoteresources3:${TRAVIS_TAG}-ppc64le"
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+$
- name: building s390x image
arch: s390x
script:
# Audit npm packages. Fail build whan a PR audit fails, otherwise report the vulnerability and proceed.
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then npm audit; else npm audit || true; fi
- npm test
- if [[ $TRAVIS_TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then npm version --no-git-tag-version "${TRAVIS_TAG}"; fi
- docker build --rm -t "quay.io/razee/remoteresources3:${TRAVIS_COMMIT}-s390x" .
- if [ -n "${TRAVIS_TAG}" ]; then docker tag quay.io/razee/remoteresources3:${TRAVIS_COMMIT}-s390x quay.io/razee/remoteresources3:${TRAVIS_TAG}-s390x; fi
- docker images
- ./build/process-template.sh kubernetes/RemoteResourceS3/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/remoteresources3:${TRAVIS_TAG}-s390x"
skip_cleanup: true
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/remoteresources3:${TRAVIS_TAG}-s390x"
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+$
- stage: publish multi-arch image, npm & github release
arch: amd64
script:
- if [[ $TRAVIS_TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then npm version --no-git-tag-version "${TRAVIS_TAG}"; fi
- ./build/process-template.sh kubernetes/RemoteResourceS3/resource.yaml >/tmp/resource.yaml
- export DOCKER_CLI_EXPERIMENTAL=enabled
- sudo chown -R $USER:$USER /etc/docker/
- |
if [ -n "${TRAVIS_TAG}" ]; then
docker manifest create quay.io/razee/remoteresources3:${TRAVIS_TAG} \
quay.io/razee/remoteresources3:${TRAVIS_TAG}-amd64 \
quay.io/razee/remoteresources3:${TRAVIS_TAG}-ppc64le \
quay.io/razee/remoteresources3:${TRAVIS_TAG}-s390x
fi
before_deploy:
- docker login -u="${QUAY_ID}" -p="${QUAY_TOKEN}" quay.io
deploy:
# Deploy alpha builds
- provider: script
script: docker manifest push "quay.io/razee/remoteresources3:${TRAVIS_TAG}"
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+_[0-9]{3}$
# Deploy released builds
- provider: script
script: docker manifest push "quay.io/razee/remoteresources3:${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: "${GITHUB_TOKEN}"
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+$
- provider: npm
email: "${NPMJS_EMAIL}"
api_key: "${NPMJS_API_KEY}"
name: "${TRAVIS_TAG}"
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+$