forked from suricats/surirobot-api-converse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
70 lines (63 loc) · 1.42 KB
/
.gitlab-ci.yml
File metadata and controls
70 lines (63 loc) · 1.42 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
image: python:3.6
stages:
- test
- github
- build
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
cache:
paths:
- .cache/
- venv/
test:
stage: test
before_script:
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
- pip install -r requirements.txt
- tools/get-credentials
script:
- pytest --cov=api
test_externalapi:
before_script:
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
- pip install -r requirements.txt
- tools/get-credentials
script:
- pytest -m externalapi
only:
- schedules
build_docker_image:
image: docker:stable
services:
- docker:dind
stage: build
before_script:
- apk add --no-cache curl
- tools/get-credentials
script:
- docker build -t api-converse .
- docker run -v /builds/$CI_PROJECT_PATH/res/credentials:/app/res/credentials --entrypoint pytest api-converse
only:
- master
tags:
- docker
mirror_to_github:
stage: github
script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- ssh-add <(echo "$GITHUB_DEPLOY_KEY")
- ssh-keyscan -H github.com > ~/.ssh/known_hosts
- git remote rm github || true
- git remote add github $GITHUB_DEPLOY_URL
- git fetch github
- git push github HEAD:master --force
only:
- master
except:
- schedules