This repository has been archived by the owner on Sep 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
119 lines (113 loc) · 4.87 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
dist: xenial
addons:
apt:
packages:
- docker-ce
jobs:
include:
- stage: build
name: "build image"
if: (tag IS blank)
sudo: required
services:
- docker
script:
- echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
- docker run --privileged linuxkit/binfmt:v0.6
- docker run -d --privileged -p 1337:1337 --name buildkit moby/buildkit:v0.7.2 --addr tcp://0.0.0.0:1337 --oci-worker-platform linux/amd64 --oci-worker-platform linux/arm/v7
- docker cp buildkit:/usr/bin/buildctl .
- export BUILDKIT_HOST=tcp://0.0.0.0:1337
- |
./buildctl build --frontend dockerfile.v0 \
--frontend-opt platform=linux/arm/v7 \
--frontend-opt filename=./Dockerfile.armv7 \
--exporter image \
--exporter-opt name=docker.io/hackerh/ydns-updater:armv7-latest \
--exporter-opt push=false \
--local dockerfile=. \
--local context=.
- |
./buildctl build --frontend dockerfile.v0 \
--frontend-opt platform=linux/amd64 \
--frontend-opt filename=./Dockerfile.amd64 \
--exporter image \
--exporter-opt name=docker.io/hackerh/ydns-updater:amd64-latest \
--exporter-opt push=false \
--local dockerfile=. \
--local context=.
- stage: build
name: "push latest image"
if: (branch = master AND NOT type = pull_request)
sudo: required
services:
- docker
script:
- echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
- docker run --privileged linuxkit/binfmt:v0.6
- docker run -d --privileged -p 1337:1337 --name buildkit moby/buildkit:v0.7.2 --addr tcp://0.0.0.0:1337 --oci-worker-platform linux/amd64 --oci-worker-platform linux/arm/v7
- docker cp buildkit:/usr/bin/buildctl .
- export BUILDKIT_HOST=tcp://0.0.0.0:1337
- |
./buildctl build --frontend dockerfile.v0 \
--frontend-opt platform=linux/arm/v7 \
--frontend-opt filename=./Dockerfile.armv7 \
--exporter image \
--exporter-opt name=docker.io/hackerh/ydns-updater:armv7-latest \
--exporter-opt push=true \
--local dockerfile=. \
--local context=.
- |
./buildctl build --frontend dockerfile.v0 \
--frontend-opt platform=linux/amd64 \
--frontend-opt filename=./Dockerfile.amd64 \
--exporter image \
--exporter-opt name=docker.io/hackerh/ydns-updater:amd64-latest \
--exporter-opt push=true \
--local dockerfile=. \
--local context=.
- export DOCKER_CLI_EXPERIMENTAL=enabled
- |
docker manifest create hackerh/ydns-updater:latest \
hackerh/ydns-updater:amd64-latest \
hackerh/ydns-updater:armv7-latest
- docker manifest annotate hackerh/ydns-updater:latest hackerh/ydns-updater:amd64-latest --arch amd64
- docker manifest annotate hackerh/ydns-updater:latest hackerh/ydns-updater:armv7-latest --arch arm --variant v7
- docker manifest push hackerh/ydns-updater:latest
- stage: build
name: "push tagged image"
if: (tag IS present)
sudo: required
services:
- docker
script:
- echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
- docker run --privileged linuxkit/binfmt:v0.6
- docker run -d --privileged -p 1337:1337 --name buildkit moby/buildkit:v0.7.2 --addr tcp://0.0.0.0:1337 --oci-worker-platform linux/amd64 --oci-worker-platform linux/arm/v7
- docker cp buildkit:/usr/bin/buildctl .
- export BUILDKIT_HOST=tcp://0.0.0.0:1337
- |
./buildctl build --frontend dockerfile.v0 \
--frontend-opt platform=linux/arm/v7 \
--frontend-opt filename=./Dockerfile.armv7 \
--exporter image \
--exporter-opt name=docker.io/hackerh/ydns-updater:armv7-"${TRAVIS_TAG}" \
--exporter-opt push=true \
--local dockerfile=. \
--local context=.
- |
./buildctl build --frontend dockerfile.v0 \
--frontend-opt platform=linux/amd64 \
--frontend-opt filename=./Dockerfile.amd64 \
--exporter image \
--exporter-opt name=docker.io/hackerh/ydns-updater:amd64-"${TRAVIS_TAG}" \
--exporter-opt push=true \
--local dockerfile=. \
--local context=.
- export DOCKER_CLI_EXPERIMENTAL=enabled
- |
docker manifest create hackerh/ydns-updater:"${TRAVIS_TAG}" \
hackerh/ydns-updater:amd64-"${TRAVIS_TAG}" \
hackerh/ydns-updater:armv7-"${TRAVIS_TAG}"
- docker manifest annotate hackerh/ydns-updater:"${TRAVIS_TAG}" hackerh/ydns-updater:amd64-"${TRAVIS_TAG}" --arch amd64
- docker manifest annotate hackerh/ydns-updater:"${TRAVIS_TAG}" hackerh/ydns-updater:armv7-"${TRAVIS_TAG}" --arch arm --variant v7
- docker manifest push hackerh/ydns-updater:"${TRAVIS_TAG}"