-
Notifications
You must be signed in to change notification settings - Fork 16
/
.cirrus.yml
97 lines (88 loc) · 3.33 KB
/
.cirrus.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
task:
only_if: $CIRRUS_TAG == ''
timeout_in: 120m
matrix:
- name: linux-amd64
compute_engine_instance:
image_project: cirrus-images
image: family/docker-builder
platform: linux
cpu: 8
memory: 8G
- name: linux-arm64
compute_engine_instance:
image_project: cirrus-images
image: family/docker-builder-arm64
architecture: arm64
platform: linux
cpu: 4
memory: 4G
build_script: make build
run_script: make test
task:
only_if: $CIRRUS_TAG != ''
alias: build-linux-image
timeout_in: 120m
env:
DOCKER_USERNAME: ENCRYPTED[db65fd6fc1af68040964a27c82f2cbd202c849199038cfddc961a573d803a4f2793ba30eede0b6bcdb6bbf29f5c4f012]
DOCKER_PASSWORD: ENCRYPTED[a1503baddfbe37c5a4474c46ec12b11beee3d16c054c1fa5bfcdde674be32524781f9d4e4d9444db6575fc5aa6270040]
matrix:
- name: linux-amd64
env:
CIRRUS_ARCH: amd64
compute_engine_instance:
image_project: cirrus-images
image: family/docker-builder
platform: linux
cpu: 8
memory: 8G
- name: linux-arm64
env:
CIRRUS_ARCH: arm64
compute_engine_instance:
image_project: cirrus-images
image: family/docker-builder-arm64
architecture: arm64
platform: linux
cpu: 4
memory: 4G
build_script: TAG=$CIRRUS_ARCH make build
login_script: docker login --username $DOCKER_USERNAME --password $DOCKER_PASSWORD
push_script: docker push joseluisq/rust-linux-darwin-builder:$CIRRUS_ARCH
release_docker_builder:
only_if: $CIRRUS_TAG != ''
depends_on:
- build-linux-image
env:
DOCKER_USERNAME: ENCRYPTED[db65fd6fc1af68040964a27c82f2cbd202c849199038cfddc961a573d803a4f2793ba30eede0b6bcdb6bbf29f5c4f012]
DOCKER_PASSWORD: ENCRYPTED[a1503baddfbe37c5a4474c46ec12b11beee3d16c054c1fa5bfcdde674be32524781f9d4e4d9444db6575fc5aa6270040]
login_script: |
docker login --username $DOCKER_USERNAME --password $DOCKER_PASSWORD
push_latest_script: |
docker manifest create \
joseluisq/rust-linux-darwin-builder:latest \
--amend joseluisq/rust-linux-darwin-builder:amd64 \
--amend joseluisq/rust-linux-darwin-builder:arm64
docker manifest push joseluisq/rust-linux-darwin-builder:latest
pull_latest_script: |
docker pull joseluisq/rust-linux-darwin-builder:amd64
docker pull joseluisq/rust-linux-darwin-builder:arm64
push_aliases_script: |
SEMVER=${CIRRUS_TAG##*v}
SEMVER_MAJOR=${SEMVER%.*.*}
SEMVER_MINOR=${SEMVER%.*}
docker manifest create \
joseluisq/rust-linux-darwin-builder:${SEMVER} \
--amend joseluisq/rust-linux-darwin-builder:amd64 \
--amend joseluisq/rust-linux-darwin-builder:arm64
docker manifest push joseluisq/rust-linux-darwin-builder:${SEMVER}
docker manifest create \
joseluisq/rust-linux-darwin-builder:${SEMVER_MAJOR} \
--amend joseluisq/rust-linux-darwin-builder:amd64 \
--amend joseluisq/rust-linux-darwin-builder:arm64
docker manifest push joseluisq/rust-linux-darwin-builder:${SEMVER_MAJOR}
docker manifest create \
joseluisq/rust-linux-darwin-builder:${SEMVER_MINOR} \
--amend joseluisq/rust-linux-darwin-builder:amd64 \
--amend joseluisq/rust-linux-darwin-builder:arm64
docker manifest push joseluisq/rust-linux-darwin-builder:${SEMVER_MINOR}