forked from openshift/oadp-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
61 lines (56 loc) · 1.68 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
os: linux
services: docker
dist: focal
language: go
go: stable
env:
global:
- IMAGE: quay.io/konveyor/oadp-operator
- DEFAULT_BRANCH: master
- DOCKERFILE: Dockerfile
- DOCKER_CLI_EXPERIMENTAL: enabled
- GOPROXY: https://goproxy.io,direct
before_install:
- |
if [ "${TRAVIS_BRANCH}" == "${DEFAULT_BRANCH}" ]; then
export TAG=latest
else
export TAG="${TRAVIS_BRANCH}"
fi
# Builds routinely fail due to download failures inside alternate arch docker containers
# Here we are downloading outside the docker container and copying the deps in
# Also use -v for downloads/builds to stop no output failures from lxd env buffering.
before_script:
- go mod vendor -v
- sed -i 's|^RUN go mod download$|COPY vendor/ vendor/|g' ${DOCKERFILE}
- sed -i 's|-mod=mod|-mod=vendor|g' ${DOCKERFILE}
- sed -i 's|go build|go build -v|g' ${DOCKERFILE}
script:
- docker build -t ${IMAGE}:${TAG}-${TRAVIS_ARCH} -f ${DOCKERFILE} .
- if [ -n "${QUAY_ROBOT}" ]; then docker login quay.io -u "${QUAY_ROBOT}" -p ${QUAY_TOKEN}; fi
- if [ -n "${QUAY_ROBOT}" ]; then docker push ${IMAGE}:${TAG}-${TRAVIS_ARCH}; fi
jobs:
include:
- stage: build images
arch: ppc64le
- arch: s390x
- arch: arm64-graviton2
virt: lxd
group: edge
- arch: amd64
- stage: push manifest
language: shell
arch: amd64
before_script: []
script:
- |
if [ -n "${QUAY_ROBOT}" ]; then
docker login quay.io -u "${QUAY_ROBOT}" -p ${QUAY_TOKEN}
docker manifest create \
${IMAGE}:${TAG} \
${IMAGE}:${TAG}-amd64 \
${IMAGE}:${TAG}-ppc64le \
${IMAGE}:${TAG}-s390x \
${IMAGE}:${TAG}-aarch64
docker manifest push ${IMAGE}:${TAG}
fi