forked from awsassets/linux-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
146 lines (129 loc) · 3.43 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
## Jobs to build and publish deb, rpm and arch based packages
include:
- project: 'ProtonVPN/Linux/_gitlab-ci'
ref: public-protonvpn-repo
file: 'message-deploy.yml'
- project: 'ProtonVPN/Linux/_gitlab-ci'
ref: public-protonvpn-repo
file: 'gitlab-ci-build-publish-debian.yml'
- project: 'ProtonVPN/Linux/_gitlab-ci'
ref: public-protonvpn-repo
file: 'gitlab-ci-build-publish-rpm.yml'
- project: 'ProtonVPN/Linux/_gitlab-ci'
ref: public-protonvpn-repo
file: 'gitlab-ci-build-publish-arch.yml'
- project: 'agarroux/publish-github'
ref: master
file: '/jobs/release.gitlab-ci.yml'
default:
image: $CI_REGISTRY_IMAGE:branch-$CI_COMMIT_REF_SLUG
stages:
- image
- test
- build
- publish
- message
- image-latest
- release
variables:
CI_REGISTRY_IMAGE_PROTON: "$CI_REGISTRY/infra/kubernetes/images"
PKGNAME_ARCH: "protonvpn-cli"
PKGNAME_RPM: "protonvpn-cli"
ORIGINAL_PKGNAME: "linux-cli"
######## Manage the Image ##########
.common-image:
image: $CI_REGISTRY/infra/kubernetes/images/docker:stable
interruptible: true
variables:
DOCKER_HOST: tcp://docker:2375
services:
- name: $CI_REGISTRY/infra/kubernetes/images/docker:dind
alias: docker
before_script:
- apk update
- apk add make bash git gawk rsync
## Make image when we push to a branch -> run tests on top of this one
make-image-deb:
stage: image
extends: .common-image
except:
- schedules
- triggers
script:
- make image-deb branch=$CI_COMMIT_REF_SLUG src=ubuntu
make-image-arch:
stage: image
extends: make-image-deb
script:
- make image-arch branch=$CI_COMMIT_REF_SLUG src=archlinux
make-image-fed33:
stage: image
extends: make-image-deb
script:
- make image-fed33 branch=$CI_COMMIT_REF_SLUG src=fedora33
make-image-fed34:
stage: image
extends: make-image-deb
script:
- make image-fed34 branch=$CI_COMMIT_REF_SLUG src=fedora34
make-image-fed35:
stage: image
extends: make-image-deb
script:
- make image-fed35 branch=$CI_COMMIT_REF_SLUG src=fedora35
######## CI Test Jobs ##########
test-deb:
stage: test
image: $CI_REGISTRY_IMAGE/ubuntu:branch-$CI_COMMIT_REF_SLUG
interruptible: true
needs:
- job: make-image-deb
script:
- python3 -m pytest
test-arch:
extends: test-deb
needs:
- job: make-image-arch
image: $CI_REGISTRY_IMAGE/archlinux:branch-$CI_COMMIT_REF_SLUG
test-fed33:
extends: test-deb
needs:
- job: make-image-fed33
image: $CI_REGISTRY_IMAGE/fedora33:branch-$CI_COMMIT_REF_SLUG
test-fed34:
extends: test-deb
needs:
- job: make-image-fed34
image: $CI_REGISTRY_IMAGE/fedora34:branch-$CI_COMMIT_REF_SLUG
test-fed35:
extends: test-deb
needs:
- job: make-image-fed35
image: $CI_REGISTRY_IMAGE/fedora35:branch-$CI_COMMIT_REF_SLUG
# Jobs to publish commits + tags from master to github
release-publish-github:
stage: release
needs:
- job: build-deb
- job: build-fed33
- job: build-fed34
- job: build-fed35
when: manual
variables:
RELEASE_SYNC_PUBLIC_URL: git@github.com:ProtonVPN/linux-cli.git
RELEASE_SYNC_TO_BRANCH: 'master'
RELEASE_SYNC_FROM_BRANCH: 'master'
extends: .release-sync-commit-shared
release-publish-github-tags:
stage: release
needs:
- job: build-deb
- job: build-fed33
- job: build-fed34
- job: build-fed35
when: manual
variables:
RELEASE_SYNC_PUBLIC_URL: git@github.com:ProtonVPN/linux-cli.git
RELEASE_SYNC_TO_BRANCH: 'master'
RELEASE_SYNC_FROM_BRANCH: 'master'
extends: .release-sync-tags-shared