forked from AVENTER-UG/docker-matrix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
95 lines (95 loc) · 4.64 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
language: generic
dist: bionic
os: linux
arch:
- amd64
- ppc64le
- arm64
services:
- docker
jobs:
include:
- stage: build docker image amd64
arch: amd64
install:
- export REPO="avhost/docker-matrix"
script:
- echo "===== building docker image $TRAVIS_CPU_ARCH ===="
- docker build --build-arg BASE_ARCH=$TRAVIS_CPU_ARCH -t $REPO:dev .
- docker images
- echo "===== preparing to run testing image $TRAVIS_CPU_ARCH ===="
- mkdir tmp && sudo chown 991:991 tmp/
- docker run --name synapse-generate -v ${PWD}/tmp/:/data --rm --user 991:991 -e SERVER_NAME=localhost -e REPORT_STATS=no $REPO:dev generate
- sudo sed -i -e "s/\['::1', '127.0.0.1'\]/['0.0.0.0']/" tmp/homeserver.yaml
- sudo sed -i -e "s/\['::', '0.0.0.0'\]/['0.0.0.0']/" tmp/homeserver.yaml
- echo "===== starting up testing image ===="
- docker run --name synapse-test -d --user 991:991 -p 8008:8008 -v ${PWD}/tmp/:/data $REPO:dev start
- echo "===== waiting for testing docker to reply to version endpoint (simple test) ===="
- docker logs synapse-test
after_success:
- echo "===== pushing $TRAVIS_CPU_ARCH to docker-hub ===="
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
- docker tag $REPO:dev $REPO:$TRAVIS_CPU_ARCH-$TRAVIS_BRANCH
- docker images
- docker push $REPO:$TRAVIS_CPU_ARCH-$TRAVIS_BRANCH
- stage: build docker image ppc64le
arch: ppc64le
install:
- export REPO="avhost/docker-matrix"
script:
- echo "===== building docker image $TRAVIS_CPU_ARCH ===="
- docker build --build-arg BASE_ARCH=$TRAVIS_CPU_ARCH -t $REPO:dev .
- docker images
- echo "===== preparing to run testing image $TRAVIS_CPU_ARCH ===="
- mkdir tmp && sudo chown 991:991 tmp/
- docker run --name synapse-generate -v ${PWD}/tmp/:/data --rm --user 991:991 -e SERVER_NAME=localhost -e REPORT_STATS=no $REPO:dev generate
- sudo sed -i -e "s/\['::1', '127.0.0.1'\]/['0.0.0.0']/" tmp/homeserver.yaml
- sudo sed -i -e "s/\['::', '0.0.0.0'\]/['0.0.0.0']/" tmp/homeserver.yaml
- echo "===== starting up testing image ===="
- docker run --name synapse-test -d --user 991:991 -p 8008:8008 -v ${PWD}/tmp/:/data $REPO:dev start
- echo "===== waiting for testing docker to reply to version endpoint (simple test) ===="
- docker logs synapse-test
after_success:
- echo "===== $TRAVIS_CPU_ARCH pushing to docker-hub ===="
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
- docker tag $REPO:dev $REPO:$TRAVIS_CPU_ARCH-$TRAVIS_BRANCH
- docker images
- docker push $REPO:$TRAVIS_CPU_ARCH-$TRAVIS_BRANCH
- stage: build docker image arm64
arch: arm64
install:
- export REPO="avhost/docker-matrix"
script:
- echo "===== building docker image $TRAVIS_CPU_ARCH ===="
- docker build --build-arg BASE_ARCH=arm64v8 -t $REPO:dev .
- docker images
- echo "===== preparing to run testing image $TRAVIS_CPU_ARCH ===="
- mkdir tmp && sudo chown 991:991 tmp/
- docker run --name synapse-generate -v ${PWD}/tmp/:/data --rm --user 991:991 -e SERVER_NAME=localhost -e REPORT_STATS=no $REPO:dev generate
- sudo sed -i -e "s/\['::1', '127.0.0.1'\]/['0.0.0.0']/" tmp/homeserver.yaml
- sudo sed -i -e "s/\['::', '0.0.0.0'\]/['0.0.0.0']/" tmp/homeserver.yaml
- echo "===== starting up testing image ===="
- docker run --name synapse-test -d --user 991:991 -p 8008:8008 -v ${PWD}/tmp/:/data $REPO:dev start
- echo "===== waiting for testing docker to reply to version endpoint (simple test) ===="
- docker logs synapse-test
after_success:
- echo "===== $TRAVIS_CPU_ARCH pushing to docker-hub ===="
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
- docker tag $REPO:dev $REPO:$TRAVIS_CPU_ARCH-$TRAVIS_BRANCH
- docker images
- docker push $REPO:$TRAVIS_CPU_ARCH-$TRAVIS_BRANCH
- stage: create manifest
arch: amd64
install:
- export REPO="avhost/docker-matrix"
script:
- echo "===== Create Manifest ===="
- docker pull $REPO:amd64-$TRAVIS_BRANCH
- docker pull $REPO:ppc64le-$TRAVIS_BRANCH
- docker pull $REPO:arm64-$TRAVIS_BRANCH
- export DOCKER_CLI_EXPERIMENTAL=enabled
- docker manifest create $REPO:$TRAVIS_BRANCH $REPO\:amd64-$TRAVIS_BRANCH $REPO\:ppc64le-$TRAVIS_BRANCH $REPO\:arm64-$TRAVIS_BRANCH
- docker manifest create $REPO:latest $REPO\:amd64-$TRAVIS_BRANCH $REPO\:ppc64le-$TRAVIS_BRANCH $REPO\:arm64-$TRAVIS_BRANCH
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
- docker manifest push $REPO:$TRAVIS_BRANCH
- docker manifest push $REPO:latest