-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
54 lines (49 loc) · 1.44 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
image: atnartur/docker:latest
stages:
- test
- build
# - deploy
Test:
stage: test
tags:
- dind
services:
- docker:dind
variables:
POSTGRES_USER: 'pear2pay'
POSTGRES_PASSWORD: ''
POSTGRES_DB: 'test_pear2pay'
POSTGRES_HOST_AUTH_METHOD: trust
CELERY_BROKER_URL: 'redis://redis:6379/0'
DOCKER_HOST: 'tcp://docker:2376'
DOCKER_TLS_VERIFY: 1
DOCKER_TLS_CERTDIR: '/certs'
DOCKER_CERT_PATH: '$DOCKER_TLS_CERTDIR/client'
DOCKER_DRIVER: overlay2
script:
- docker build -t odevlib-test -f ci/Dockerfile.test .
- docker run --rm odevlib-test
Build docs:
stage: build
tags:
- docker
variables:
IMAGE_NAME: "$CI_REGISTRY_IMAGE/docs"
script:
- rm -rf sphinx_rtd_dark_mode_repo
- git clone https://github.com/IamMaxim/sphinx_rtd_dark_mode.git sphinx_rtd_dark_mode_repo
- rm sphinx_rtd_dark_mode
- cp -r sphinx_rtd_dark_mode_repo/sphinx_rtd_dark_mode .
- docker build -t "$IMAGE_NAME:$CI_COMMIT_SHA" -t "$IMAGE_NAME:latest" -f docs/Dockerfile .
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker push "$IMAGE_NAME:$CI_COMMIT_SHA"
# Deploy docs:
# stage: deploy
# needs:
# - Build docs
# variables:
# IMAGE_NAME: "$CI_REGISTRY_IMAGE/docs"
# script:
# - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
# - docker-compose -f ci/docker-compose.docs.yml pull
# - docker-compose -f ci/docker-compose.docs.yml up -d