-
Notifications
You must be signed in to change notification settings - Fork 26
/
.gitlab-ci.yml
157 lines (148 loc) · 3.56 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
147
148
149
150
151
152
153
154
155
156
157
image: hatsoftwares/lufi-test-ci:bullseye
stages:
- create_release
- publish_changelog
- pouet_it
- carton
- carton_bdd
- tests
variables:
POSTGRES_DB: lufi_db
POSTGRES_USER: lufi
POSTGRES_PASSWORD: lufi_pwd
MYSQL_DATABASE: lufi_db
MYSQL_USER: lufi
MYSQL_PASSWORD: lufi_pwd
MYSQL_ROOT_PASSWORD: root
### Jobs templates
##
#
.retry: &retry
retry: 2
except:
- tags
.carton_bdd_template: &carton_bdd_definition
<<: *retry
stage: carton_bdd
cache:
key: "$CI_COMMIT_REF_NAME"
paths:
- local/
policy: pull
artifacts:
paths:
- local.tar
expire_in: 3 hours
needs:
- carton
after_script:
- tar cf local.tar local/
.tests_template: &tests_template
<<: *retry
stage: tests
coverage: '/Total.* (\d+\.\d+)$/'
before_script:
- tar xf local.tar && rm local.tar
- which mariadb_config && cd $(dirname $(which mariadb_config)) && ln -s mariadb_config mysql_config
- cd $CI_PROJECT_DIR
- pwd
script:
- MOJO_CONFIG="t/${CI_JOB_NAME}.conf" make test
- MOJO_CONFIG="t/${CI_JOB_NAME}.conf" make cover
.sqlite_template: &sqlite_definition
<<: *tests_template
needs:
- carton_sqlite
services:
- name: rroemhild/test-openldap
alias: rroemhild-test-openldap
# - name: openstackswift/saio
# alias: swiftstack-picoswiftstack
.pg_template: &pg_definition
<<: *tests_template
needs:
- carton_postgresql
services:
- name: postgres:11
alias: postgres
- name: rroemhild/test-openldap
alias: rroemhild-test-openldap
# - name: openstackswift/saio
# alias: swiftstack-picoswiftstack
.mysql_template: &mysql_definition
<<: *tests_template
needs:
- carton_mysql
services:
- name: mariadb:10.3
alias: mariadb
- name: rroemhild/test-openldap
alias: rroemhild-test-openldap
# - name: openstackswift/saio
# alias: swiftstack-picoswiftstack
### Publish tag changelog and create a toot
##
#
include:
- 'https://framagit.org/fiat-tux/gitlabci-snippets/-/raw/2aac6c1f3dd725d9aed57549da67a92759f9f9ec/create-release-from-ci.gitlab-ci.yml'
- 'https://framagit.org/fiat-tux/gitlabci-snippets/-/raw/4e4e03322e95e9b0124c714456ebf1bdc02ad43f/pouet-it-from-ci.gitlab-ci.yml'
### Podcheck
##
#
podcheck:
stage: carton
script:
- make podcheck
except:
- tags
### Cpanfile.snapshot
## Used to get a cpanfile.snapshot from a fresh server (not like my dev VM)
#
#cpanfile_snapshot:
# stage: carton
# script:
# - rm cpanfile.snapshot
# - which mariadb_config && cd $(dirname $(which mariadb_config)) && ln -s mariadb_config mysql_config
# - carton install
# - cat cpanfile.snapshot
# except:
# - tags
### Install common dependencies
##
#
carton:
<<: *retry
stage: carton
cache:
key: "$CI_COMMIT_REF_NAME"
paths:
- local/
script:
- carton install --deployment --without=sqlite --without=postgresql --without=mysql
### Install DB related dependencies
##
#
carton_sqlite:
<<: *carton_bdd_definition
script:
- carton install --deployment --without=postgresql --without=mysql
carton_postgresql:
<<: *carton_bdd_definition
script:
- carton install --deployment --without=sqlite --without=mysql
carton_mysql:
<<: *carton_bdd_definition
before_script:
- which mariadb_config && cd $(dirname $(which mariadb_config)) && ln -s mariadb_config mysql_config
- cd $CI_PROJECT_DIR
script:
- carton install --deployment --without=sqlite --without=postgresql
### Tests
##
#
sqlite:
<<: *sqlite_definition
postgresql:
<<: *pg_definition
mysql:
<<: *mysql_definition