forked from silverapp/silver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
105 lines (96 loc) · 2.58 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
clone:
default:
image: plugins/git
recursive: true
group: clone
submodule_update_remote: true
submodule_override:
docs-theme: https://github.com/PressLabs/docs-theme.git
presslabs-org:
image: alpine/git
group: clone
commands:
# write the ssh key to disk
- mkdir /root/.ssh
- echo -n "$GIT_PUSH_SSH_KEY" > /root/.ssh/id_rsa
- chmod 600 /root/.ssh/id_rsa
# add github to known hosts
- touch /root/.ssh/known_hosts
- chmod 600 /root/.ssh/known_hosts
- ssh-keyscan -H github.com > /etc/ssh/ssh_known_hosts 2> /dev/null
# clone presslabs-org
- git clone -b prod [email protected]:/PressLabs/presslabs-org.git /drone/src/presslabs-org
secrets:
- GIT_PUSH_SSH_KEY
when:
branch: master
event: push
pipeline:
test:
image: presslabs/silver
pull: true
group: build
environment:
- SILVER_DB_ENGINE=django.db.backends.mysql
- SILVER_DB_NAME=test_db
- SILVER_DB_HOST=mysql
- SILVER_DB_USER=silver
- SILVER_DB_PASSWORD=silver
commands:
- make dependencies
- pip install -U "Django${DJANGO_VERSION}"
- mkdir /var/log/silver
- make lint
- make test
build-docs:
image: jobandtalent/mkdocs
group: build
commands:
- cd docs/
- pip3 install mdx_figcaption_ng
- mkdocs build --clean
- for i in $(ls | grep -v compiled_docs); do rm -rf $i; done
- mkdir -p /drone/src/presslabs-org/wp-content/root/silver/docs
- rm -rf /drone/src/presslabs-org/wp-content/root/silver/docs/*
- mv compiled_docs/* /drone/src/presslabs-org/wp-content/root/silver/docs
- rm -rf compiled_docs/
when:
branch: master
event: push
update-presslabs-org:
image: appleboy/drone-git-push
branch: prod
group: publish
commit: true
path: /drone/src/presslabs-org
commit_message: "[docs] Update silver docs"
remote: [email protected]:/Presslabs/presslabs-org.git
secrets:
- GIT_PUSH_SSH_KEY
when:
branch: master
event: push
publish-docker:
image: plugins/docker
group: publish
repo: presslabs/silver
tags: ["${DRONE_BRANCH/master/latest}", "${DRONE_COMMIT_SHA:0:7}"]
force_tag: true
secrets:
- DOCKER_USERNAME
- DOCKER_PASSWORD
when:
event: [push, tag]
services:
mysql:
image: mysql:5.5
environment:
- MYSQL_DATABASE=test_db
- MYSQL_ROOT_PASSWORD=secret
- MYSQL_USER=silver
- MYSQL_PASSWORD=silver
redis:
image: redis:3-alpine
matrix:
DJANGO_VERSION:
- <2.0