-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
146 lines (146 loc) · 5.85 KB
/
.gitlab-ci.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
stages:
- build
- test
- deploy
- manifest
services:
- docker:dind
variables:
IMAGEINT: reg.mediabutler.io/mediabutler/api
IMAGEEXT: mediabutler/server
DOCKER_CLI_EXPERIMENTAL: enabled
build_npm:
image: node:4.2.2
stage: build
script:
- npm install
test_npm:
image: node:4.2.2
stage: test
script:
- echo "Should have run npm test"
deploy_npm:
stage: deploy
image: node:4.2.2
script:
- npm install
- echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}'>.npmrc
- npm publish || true
only:
- master
deploy_docker_int_amd64:
stage: deploy
before_script:
- docker login -u "gitlab-ci-token" -p $CI_JOB_TOKEN reg.mediabutler.io
script:
- docker build -t ${IMAGEINT}:amd64-${CI_COMMIT_REF_NAME} .
- docker push ${IMAGEINT}:amd64-${CI_COMMIT_REF_NAME}
deploy_docker_int_arm32v6:
stage: deploy
before_script:
- docker login -u "gitlab-ci-token" -p $CI_JOB_TOKEN reg.mediabutler.io
script:
- docker build --build-arg IMAGE_ARCH=arm32v6 -t ${IMAGEINT}:arm32v6-${CI_COMMIT_REF_NAME} .
- docker push ${IMAGEINT}:arm32v6-${CI_COMMIT_REF_NAME}
deploy_docker_int_arm32v7:
stage: deploy
before_script:
- docker login -u "gitlab-ci-token" -p $CI_JOB_TOKEN reg.mediabutler.io
script:
- docker build --build-arg IMAGE_ARCH=arm32v7 -t ${IMAGEINT}:arm32v7-${CI_COMMIT_REF_NAME} .
- docker push ${IMAGEINT}:arm32v7-${CI_COMMIT_REF_NAME}
deploy_docker_int_arm64v8:
stage: deploy
before_script:
- docker login -u "gitlab-ci-token" -p $CI_JOB_TOKEN reg.mediabutler.io
script:
- docker build --build-arg IMAGE_ARCH=arm64v8 -t ${IMAGEINT}:arm64v8-${CI_COMMIT_REF_NAME} .
- docker push ${IMAGEINT}:arm64v8-${CI_COMMIT_REF_NAME}
deploy_docker_int_i386:
stage: deploy
before_script:
- docker login -u "gitlab-ci-token" -p $CI_JOB_TOKEN reg.mediabutler.io
script:
- docker build --build-arg IMAGE_ARCH=i386 -t ${IMAGEINT}:i386-${CI_COMMIT_REF_NAME} .
- docker push ${IMAGEINT}:i386-${CI_COMMIT_REF_NAME}
manifest_int:
stage: manifest
before_script:
- docker login -u "gitlab-ci-token" -p $CI_JOB_TOKEN reg.mediabutler.io
script:
- docker pull ${IMAGEINT}:amd64-${CI_COMMIT_REF_NAME}
- docker pull ${IMAGEINT}:arm32v6-${CI_COMMIT_REF_NAME}
- docker pull ${IMAGEINT}:arm32v7-${CI_COMMIT_REF_NAME}
- docker pull ${IMAGEINT}:arm64v8-${CI_COMMIT_REF_NAME}
- docker pull ${IMAGEINT}:i386-${CI_COMMIT_REF_NAME}
- docker manifest create ${IMAGEINT}:${CI_COMMIT_REF_NAME} ${IMAGEINT}:amd64-${CI_COMMIT_REF_NAME} ${IMAGEINT}:arm32v6-${CI_COMMIT_REF_NAME} ${IMAGEINT}:arm32v7-${CI_COMMIT_REF_NAME} ${IMAGEINT}:arm64v8-${CI_COMMIT_REF_NAME} ${IMAGEINT}:i386-${CI_COMMIT_REF_NAME}
- docker manifest annotate ${IMAGEINT}:${CI_COMMIT_REF_NAME} ${IMAGEINT}:amd64-${CI_COMMIT_REF_NAME} --os linux --arch amd64
- docker manifest annotate ${IMAGEINT}:${CI_COMMIT_REF_NAME} ${IMAGEINT}:arm32v6-${CI_COMMIT_REF_NAME} --os linux --arch arm --variant v6
- docker manifest annotate ${IMAGEINT}:${CI_COMMIT_REF_NAME} ${IMAGEINT}:arm32v7-${CI_COMMIT_REF_NAME} --os linux --arch arm --variant v7
- docker manifest annotate ${IMAGEINT}:${CI_COMMIT_REF_NAME} ${IMAGEINT}:arm64v8-${CI_COMMIT_REF_NAME} --os linux --arch arm64 --variant armv8
- docker manifest annotate ${IMAGEINT}:${CI_COMMIT_REF_NAME} ${IMAGEINT}:i386-${CI_COMMIT_REF_NAME} --os linux --arch 386
- docker manifest push ${IMAGEINT}:${CI_COMMIT_REF_NAME}
deploy_docker_ext_amd64:
stage: deploy
before_script:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD docker.io
script:
- docker build -t ${IMAGEEXT}:amd64-latest .
- docker push ${IMAGEEXT}:amd64-latest
only:
- master
deploy_docker_ext_arm32v6:
stage: deploy
before_script:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD docker.io
script:
- docker build --build-arg IMAGE_ARCH=arm32v6 -t ${IMAGEEXT}:arm32v6-latest .
- docker push ${IMAGEEXT}:arm32v6-latest
only:
- master
deploy_docker_ext_arm32v7:
stage: deploy
before_script:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD docker.io
script:
- docker build --build-arg IMAGE_ARCH=arm32v7 -t ${IMAGEEXT}:arm32v7-latest .
- docker push ${IMAGEEXT}:arm32v7-latest
only:
- master
deploy_docker_ext_arm64v8:
stage: deploy
before_script:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD docker.io
script:
- docker build --build-arg IMAGE_ARCH=arm64v8 -t ${IMAGEEXT}:arm64v8-latest .
- docker push ${IMAGEEXT}:arm64v8-latest
only:
- master
deploy_docker_ext_i386:
stage: deploy
before_script:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD docker.io
script:
- docker build --build-arg IMAGE_ARCH=i386 -t ${IMAGEEXT}:i386-latest .
- docker push ${IMAGEEXT}:i386-latest
only:
- master
manifest_ext:
stage: manifest
before_script:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD docker.io
script:
- docker pull ${IMAGEEXT}:amd64-latest
- docker pull ${IMAGEEXT}:arm32v6-latest
- docker pull ${IMAGEEXT}:arm32v7-latest
- docker pull ${IMAGEEXT}:arm64v8-latest
- docker pull ${IMAGEEXT}:i386-latest
- docker manifest create ${IMAGEEXT}:latest ${IMAGEEXT}:amd64-latest ${IMAGEEXT}:arm32v6-latest ${IMAGEEXT}:arm32v7-latest ${IMAGEEXT}:arm64v8-latest ${IMAGEEXT}:i386-latest
- docker manifest annotate ${IMAGEEXT}:latest ${IMAGEEXT}:amd64-latest --os linux --arch amd64
- docker manifest annotate ${IMAGEEXT}:latest ${IMAGEEXT}:arm32v6-latest --os linux --arch arm --variant v6
- docker manifest annotate ${IMAGEEXT}:latest ${IMAGEEXT}:arm32v7-latest --os linux --arch arm --variant v7
- docker manifest annotate ${IMAGEEXT}:latest ${IMAGEEXT}:arm64v8-latest --os linux --arch arm64 --variant armv8
- docker manifest annotate ${IMAGEEXT}:latest ${IMAGEEXT}:i386-latest --os linux --arch 386
- docker manifest push ${IMAGEEXT}:latest
only:
- master