-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
76 lines (65 loc) · 1.84 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
---
variables:
GIT_DEPTH: 1
image: docker:git
services:
- docker:dind
.docker_login: &docker_login |
echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
.docker_login_dockerhub: &docker_login_dockerhub |
echo "$CI_DOCKER_REGISTRY_PASSWORD" | docker login -u "$CI_DOCKER_REGISTRY_USER" --password-stdin "$CI_DOCKER_REGISTRY"
stages:
- test
- build
run-tests-3-12:
stage: test
image: python:3.12.4-alpine3.20
script:
- apk --update --no-cache add python3 python3-dev py-pip openldap-dev build-base postgresql-dev libffi libffi-dev curl gcc musl-dev
- pip install --upgrade pip
- pip install wheel tox
- tox
run-tests-3-8:
stage: test
image: python:3.8-alpine3.14
script:
- apk --update --no-cache add python3 python3-dev py-pip openldap-dev build-base postgresql-dev libffi libffi-dev curl gcc musl-dev
- pip install --upgrade pip
- pip install wheel tox
- tox
build-master:
stage: build
script:
- *docker_login
- docker build -f docker/Dockerfile --pull -t "$CI_REGISTRY_IMAGE:latest" .
- docker push "$CI_REGISTRY_IMAGE"
only:
refs:
- master
build:
stage: build
script:
- *docker_login
- docker build -f docker/Dockerfile --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME" .
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
except:
refs:
- master
build-master-dockerhub:
stage: build
script:
- *docker_login_dockerhub
- docker build -f docker/Dockerfile --pull -t "$CI_DOCKER_REGISTRY_IMAGE:latest" .
- docker push "$CI_DOCKER_REGISTRY_IMAGE"
only:
refs:
- master
build-dockerhub:
stage: build
script:
- *docker_login_dockerhub
- docker build -f docker/Dockerfile --pull -t "$CI_DOCKER_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME" .
- docker push "$CI_DOCKER_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
except:
refs:
- master