-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
55 lines (45 loc) · 2.48 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
sudo: required
language: bash
services:
- docker
before_install:
# Update docker for multi-stage build
- sudo service docker stop
- curl -fsSL https://get.docker.com/ | sudo sh
# Prepare qemu
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
# Get qemu-arm-static binary
- mkdir tmp
- >
pushd tmp &&
curl -L -o qemu-arm-static.tar.gz https://github.com/multiarch/qemu-user-static/releases/download/v2.9.1-1/qemu-arm-static.tar.gz &&
tar xzf qemu-arm-static.tar.gz &&
curl -L -o qemu-aarch64-static.tar.gz https://github.com/multiarch/qemu-user-static/releases/download/v2.9.1-1/qemu-aarch64-static.tar.gz &&
tar xzf qemu-aarch64-static.tar.gz &&
popd
script:
# Build all images
- docker build --build-arg PLATFORM=linux-amd64 -t larsks/logitech-media-server:linux-amd64 -f Dockerfile.linux-amd64 .
- docker build --build-arg PLATFORM=linux-arm -t larsks/logitech-media-server:linux-arm -f Dockerfile.linux-arm32v7 .
- docker build --build-arg PLATFORM=linux-arm64 -t larsks/logitech-media-server:linux-arm64 -f Dockerfile.linux-arm64v8 .
after_success:
- >
if [ -n "$TRAVIS_TAG" ]; then
# Docker login
echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin
# Docker Tag
docker tag larsks/logitech-media-server:linux-amd64 larsks/logitech-media-server:${TRAVIS_TAG}-linux-amd64
docker tag larsks/logitech-media-server:linux-arm larsks/logitech-media-server:${TRAVIS_TAG}-linux-arm
docker tag larsks/logitech-media-server:linux-arm64 larsks/logitech-media-server:${TRAVIS_TAG}-linux-arm64
# Docker Push
docker push larsks/logitech-media-server:${TRAVIS_TAG}-linux-amd64
docker push larsks/logitech-media-server:${TRAVIS_TAG}-linux-arm
docker push larsks/logitech-media-server:${TRAVIS_TAG}-linux-arm64
# Download manifest-tool
wget https://github.com/estesp/manifest-tool/releases/download/v0.7.0/manifest-tool-linux-amd64
mv manifest-tool-linux-amd64 manifest-tool
chmod +x manifest-tool
# Create and push manifest-list
./manifest-tool push from-args --platforms linux/amd64,linux/arm,linux/arm64 --template "larsks/logitech-media-server:${TRAVIS_TAG}-OS-ARCH" --target "larsks/logitech-media-server:$TRAVIS_TAG"
./manifest-tool push from-args --platforms linux/amd64,linux/arm,linux/arm64 --template "larsks/logitech-media-server:${TRAVIS_TAG}-OS-ARCH" --target "larsks/logitech-media-server:latest"
fi