-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
116 lines (105 loc) · 2.71 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
# Match the python versions in:
# - pyproject.toml
# https://github.com/dazza-codes/docker-python
# https://hub.docker.com/r/dazzacodes/docker-python
# provides a base image using docker:19.03 with python 3.6;
# the docker:19.03 image is based on alpine:3.11
image: dazzacodes/docker-python:3.7
services:
- docker:19.03.6-dind
- postgres:12.2-alpine
variables:
# Specify to Docker where to create the certificates, Docker will
# create them automatically on boot, and will create
# `/certs/client` that will be shared between the service and job
# container, thanks to volume mount from config.toml
DOCKER_TLS_CERTDIR: "/certs"
POSTGRES_DB: nice_marmot
POSTGRES_USER: runner
POSTGRES_PASSWORD: ""
POSTGRES_HOST_AUTH_METHOD: trust
cache:
paths:
- .venv/
before_script:
- ls -al ./*
## aio-aws tests require moto-server which requires docker to run batch jobs
- docker info
# NOTE: docker run does not exit! It hangs the build at this point.
#- docker run alpine:latest /bin/sh -c 'echo Hello Alpine'
##
## mock AWS credentials with no content
- test -f ~/.aws/credentials && rm ~/.aws/credentials
- export AWS_SECRET_ACCESS_KEY=dummy_AWS_SECRET_ACCESS_KEY
- export AWS_ACCESS_KEY_ID=dummy_AWS_ACCESS_KEY_ID
##
## Install build dependencies - do NOT add python3 here - compare with
## https://github.com/dazza-codes/docker-python/blob/master/Dockerfile-docker.template
- apk add --update --no-cache curl git glib libstdc++ make sed
##
## Install database dependencies
- apk add --update --no-cache musl-dev postgresql-dev postgresql-libs
##
## Install project dependencies
- curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -o /tmp/get-poetry.py
- python /tmp/get-poetry.py
- source ${HOME}/.poetry/env
- poetry config virtualenvs.in-project true
- poetry run pip install --upgrade pip
- poetry install -v --no-interaction
- pip freeze -v
stages:
- code-test
- deploy
# code_quality:
# stage: code-test
# allow_failure: true
# only:
# refs:
# - merge_requests
# script:
# - make lint && make typehint
code_test:
stage: code-test
only:
refs:
- master
- merge_requests
changes:
- package/**/*
- tests/**/*
- Makefile
- pyproject.toml
script:
- make coverage
package:
stage: deploy
only:
refs:
- master
script:
- make package-check
artifacts:
paths:
- dist/
pages:
allow_failure: true
stage: deploy
only:
refs:
- master
script:
- make docs
- mv docs/_build/html/ public/
artifacts:
paths:
- public
#publish:
# stage: deploy
# only:
# refs:
# - master
# script:
# - make publish
# only:
# - tags