-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
53 lines (42 loc) · 1.05 KB
/
.gitlab-ci.yml
File metadata and controls
53 lines (42 loc) · 1.05 KB
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
image: python:3.9
stages:
- test
- release
test:
stage: test
script:
- env | sort
- pip install -r requirements-dev.txt
- ./manage.py test
release-docker:
image: docker
stage: release
services:
- docker:dind
rules:
- if: $CI_COMMIT_TAG =~ /^v\d+\.\d+.*$/
when: on_success
- if: $CI_COMMIT_BRANCH == "master"
when: on_success
- when: never
script:
- env | sort
- git fetch --tags
- export TAG=latest
- if [ "$CI_COMMIT_BRANCH" == "master" ]; then export TAG=master; else export TAG=${CI_COMMIT_TAG:1}; fi
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
- docker build -t squadproject/squad-client:${TAG} .
- docker push squadproject/squad-client:${TAG}
release-pypi:
stage: release
variables:
SQUAD_CLIENT_RELEASE: 1
rules:
- if: $CI_COMMIT_TAG =~ /^v\d+\.\d+.*$/
when: on_success
- when: never
script:
- env | sort
- python3 -m pip install --upgrade twine build
- ./scripts/build ${CI_COMMIT_TAG}
- twine upload dist/*