forked from presslabs/gitfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
83 lines (76 loc) · 2.47 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
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
pipeline:
test:
image: ubuntu:trusty
group: build
privileged: true
environment:
- PIP_DOWNLOAD_CACHE=/tmp/pip_download_cache
- DEBIAN_FRONTEND=noninteractive
commands:
- apt-get update && apt-get install -qy build-essential python-pip python-virtualenv python-dev software-properties-common python-software-properties libfuse-dev fuse git libffi-dev python3.4-dev
- sudo add-apt-repository -y ppa:presslabs/gitfs
- sudo apt-get update
- sudo apt-get install -y libgit2 libgit2-dev
- sudo chmod 660 /dev/fuse
- echo user_allow_other | sudo tee -a /etc/fuse.conf > /dev/null
- sudo chmod 644 /etc/fuse.conf
- git config --global user.email "[email protected]"
- git config --global user.name "Drone CI"
- make test
volumes:
- /var/cache/apt/:/var/cache/apt/
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/gitfs/docs
- rm -rf /drone/src/presslabs-org/wp-content/root/gitfs/docs/*
- mv compiled_docs/* /drone/src/presslabs-org/wp-content/root/gitfs/docs
- rm -rf compiled_docs/
when:
branch: master
update-presslabs-org:
image: appleboy/drone-git-push
branch: prod
group: docs
commit: true
path: /drone/src/presslabs-org
commit_message: "[docs] Update gitfs docs"
remote: [email protected]:/Presslabs/presslabs-org.git
secrets:
- GIT_PUSH_SSH_KEY
when:
branch: master
workspace:
base: /drone
path: src/gitfs