This repository has been archived by the owner on May 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
.gitlab-ci.yml
141 lines (124 loc) · 2.93 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
---
stages:
- verify
- deployment-test
- package
- distribute
lint:
image: python:3.6
script:
- pip install virtualenv
- make lint
stage: verify
tags:
- docker
test:
image: python:3.6
script:
- pip install virtualenv
- make test
stage: verify
tags:
- docker
build_deployment_image:
script:
- sudo apt-get update -qq && sudo apt-get install -qq python3 virtualenv
- make build-orm-deployment
artifacts:
paths:
- 'lxd/dist/orm-image.tar.gz'
expire_in: 1 hour
stage: verify
tags:
- ubuntu1604
deployment_test:
script:
- sudo apt-get update -qq && sudo apt-get install -qq python3 virtualenv
- make deployment-test
stage: deployment-test
tags:
- ubuntu1604
.package_template: &package_template
image: python:3.6
script:
- pip install virtualenv
- make dist
artifacts:
paths:
- 'dist/*'
expire_in: 1 hour
stage: package
tags:
- docker
package:
<<: *package_template
only:
- /^\d+\.\d+\.\d+$/ # Example tag: 1.2.3
package_manual:
<<: *package_template
except:
- /^\d+\.\d+\.\d+$/ # Example tag: 1.2.3
when: manual
.distribute_template: &distribute_template
stage: distribute
tags:
- docker
image:
name: minio/mc
entrypoint: ["/bin/sh", "-c"]
script:
- >
mc config host add minio_host ${minio_url}
${minio_access_key} ${minio_secret_key} S3v4
- mc cp dist/*.tar.gz minio_host/orm/
distribute:
<<: *distribute_template
only:
- /^\d+\.\d+\.\d+$/ # Example tag: 1.2.3
distribute_manual:
<<: *distribute_template
except:
- /^\d+\.\d+\.\d+$/ # Example tag: 1.2.3
when: manual
.dockerize_template: &dockerize_template
tags:
- ubuntu1604
stage: distribute
script:
- make push-docker
dockerize:
<<: *dockerize_template
only:
- /^\d+\.\d+\.\d+$/ # Example tag: 1.2.3
dockerize_manual:
<<: *dockerize_template
except:
- /^\d+\.\d+\.\d+$/ # Example tag: 1.2.3
when: manual
.push_deployment_image_template: &push_deployment_image_template
stage: distribute
tags:
- docker
image:
name: minio/mc
entrypoint: ["/bin/sh", "-c"]
push_deployment_image:
<<: *push_deployment_image_template
script:
- >
mc config host add minio_host ${minio_url}
${minio_access_key} ${minio_secret_key} S3v4
- mc cp lxd/dist/orm-image.tar.gz minio_host/orm/deployment-images/orm-image.tar.gz
- mc cp lxd/dist/orm-image.tar.gz minio_host/orm/deployment-images/orm-image-${CI_COMMIT_SHA}.tar.gz
only:
- /^\d+\.\d+\.\d+$/ # Example tag: 1.2.3
push_deployment_image_manual:
<<: *push_deployment_image_template
script:
- >
mc config host add minio_host ${minio_url}
${minio_access_key} ${minio_secret_key} S3v4
- mc cp lxd/dist/orm-image.tar.gz minio_host/orm/deployment-images/orm-image-manual-${CI_COMMIT_SHA}.tar.gz
except:
- /^\d+\.\d+\.\d+$/ # Example tag: 1.2.3
when: manual