forked from christianotieno/location_service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
82 lines (79 loc) · 2.57 KB
/
.drone.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
services:
postgres:
image: postgres:10.4-alpine
environment:
- POSTGRES_USER=root
- POSTGRES_PASSWORD=root
- POSTGRES_DB=db
pipeline:
test:
image: python:3.6
commands:
- bash scripts/tcp-port-wait.sh $${DATABASE_HOST} $${DATABASE_PORT}
- bash scripts/run-tests.sh --ci
environment:
- DATABASE_ENGINE=postgresql
- DATABASE_NAME=db
- DATABASE_USER=root
- DATABASE_PASSWORD=root
- DATABASE_HOST=postgres
- DATABASE_PORT=5432
- SECRET_KEY=nothing
when:
event: [pull_request, push, tag]
build-docker-image-tag:
image: plugins/docker
registry:
from_secret: DOCKER_REGISTRY
repo:
from_secret: DOCKER_REPO
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD
auto_tag: true
insecure: true
file: Dockerfile
when:
event: [tag]
status: [success]
deploy-docs:
image: python:3.6
commands:
- bash scripts/tcp-port-wait.sh $${DATABASE_HOST} $${DATABASE_PORT}
- pip install -r requirements/base.txt
- python manage.py generate_swagger > swagger.json
- eval "$(ssh-agent -s)"
- mkdir -p /root/.ssh
- echo "$${SSH_KEY}\n" > /root/.ssh/id_rsa
- echo "$${SSH_PUBLIC_KEY}\n" > /root/.ssh/id_rsa.pub
- ssh-keyscan -t rsa github.com >> /root/.ssh/known_hosts
- chmod 600 /root/.ssh/id_rsa*
- ssh-add -k /root/.ssh/id_rsa
- git config --global user.email "[email protected]"
- git config --global user.name "HumanitecBot"
- git clone [email protected]:Humanitec/docs-site.git
- mkdir -p docs-site/hugo/content/marketplace/location-module/location-service/
- mkdir -p docs-site/api/marketplace/location-service/
- cd docs-site/hugo/content/marketplace/location-module/location-service/
- cp ../../../../../../README.md _index.md -r
- cd ../../../../../api/marketplace/location-service
- cp ../../../../swagger.json swagger.json -r
- cd ../../../
- git add .
- git diff-index --quiet HEAD || git commit -m "Updated documentation for Location Service"
- git push origin master
environment:
- DATABASE_ENGINE=postgresql
- DATABASE_NAME=db
- DATABASE_USER=root
- DATABASE_PASSWORD=root
- DATABASE_HOST=postgres
- DATABASE_PORT=5432
- DJANGO_SETTINGS_MODULE=location_service.settings.base
- SECRET_KEY=nothing
secrets: [NPM_USER, NPM_EMAIL, SSH_KEY, SSH_PUBLIC_KEY]
when:
event: [push, tag]
branch: [master]
status: [success]