forked from cgwire/zou
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
48 lines (42 loc) · 1.24 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
stages:
- test
- deploy
tests:python:
stage: test
image: python:3.7.6
except:
- tags
services:
- postgres:9
variables:
AUTH_STRATEGY: auth_local_no_password
DB_HOST: postgres
POSTGRES_DB: zoudb
POSTGRES_PASSWORD: mysecretpassword
POSTGRES_USER: postgres
script:
# Create thumbnail folder
- export PREVIEW_FOLDER=$(pwd)/data # Note: ABSOLUTE path required
- mkdir -p $PREVIEW_FOLDER
# Install pg_dump
- apt-get update
- apt-get install postgresql-client --yes
# Install requirements
- pip install -r requirements.txt
# Run Tests
- PYTHONPATH=. py.test --ignore=tests/auth/test_auth_route.py
tags:
- test
stack_deploy:
stage: deploy
only:
- tags
tags:
- publish
script:
- sudo docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- sudo docker pull $CI_REGISTRY_IMAGE:latest || true
- sudo docker build --pull --cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA --tag $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG .
- sudo docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- sudo docker push $CI_REGISTRY_IMAGE:latest
- sudo docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG