-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
88 lines (73 loc) · 1.81 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
image: almalinux:8
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
POETRY_HOME: "$CI_PROJECT_DIR/.poetry"
GIT_SUBMODULE_STRATEGY: recursive
LC_ALL: "en_US.UTF-8"
stages:
- test
- integration_test
- deploy_test
- deploy
before_script:
- yum install epel-release -y
- yum install git sudo python39 python39-devel -y
- yum groupinstall 'Development Tools' -y
- yum install postgresql-devel -y
- python3.9 -m ensurepip
# Install poetry using recommended method
- export POETRY_HOME="$CI_PROJECT_DIR/.poetry"
- curl -sSL https://install.python-poetry.org | python3.9
- export PATH=${POETRY_HOME}/bin:${PATH}
test:
stage: test
script:
- set -e
- poetry install
- poetry run inv mypy
- poetry run inv test
tags:
- docker
integration_test:
stage: integration_test
script:
- set -e
- poetry install
- poetry run inv mypy
- poetry run inv test --integration
tags:
- docker
integration_test_with_db:
stage: integration_test
services:
- postgres:10
variables:
POSTGRES_HOST: postgres
POSTGRES_DB: der_schrank_test
POSTGRES_PORT: 5432
POSTGRES_USER: der_schrank_test
POSTGRES_PASSWORD: der_schrank_test
script:
- set -e
- poetry install -E postgres
- poetry run inv mypy
- poetry run inv test --integration
tags:
- docker
deploy to github:
stage: test
image: ubuntu:latest
before_script:
- apt update
- apt -y install openssh-client git git-lfs
variables:
# Prevent "shallow update not allowed" error.
# Set it to maximum possible count of *new* commits that you foresee being pushed to a remote.
GIT_DEPTH: 1000
only:
- main
script:
- echo "Pushing upstream"
- ./scripts/git-push [email protected]:ekut-es/automate.git main
tags:
- docker