forked from joomla/api.joomla.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
137 lines (122 loc) · 3.85 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
---
kind: pipeline
name: deploy_static_assets
clone:
steps:
- name: prepare_package
image: joomlaprojects/docker-images:packager
environment:
ssh_password:
from_secret: ssh_password
ssh_user:
from_secret: ssh_user
ssh_host:
from_secret: ssh_host
RINGCENTRAL_WEBHOOK:
from_secret: notification_url
commands:
- mkdir build
- cp -r -v archived.html css/ images/ img/ js/ index.html results.html robots.txt 403.html 404.html .htaccess ./build
- rclone config create api sftp host $ssh_host user $ssh_user pass $ssh_password port 22 use_insecure_cipher true disable_hashcheck true
- rclone copy ./build/ api:/home/api/public_html -v
- /bin/notify
trigger:
branch:
- master
event:
- push
---
kind: pipeline
name: build_documentation
clone:
steps:
- name: parameter_check1
image: debian:stable-slim
commands:
- |
if [ "$JTYPE" = "framework" ]; then
exit 0
fi
- |
if [ "$JTYPE" = "cms" ]; then
exit 0
fi
- echo "JTYPE parameter is missing. Allowed values [framework, cms]"
- exit 1
- name: parameter_check2
image: debian:stable-slim
commands:
- |
if [ $JVERSION > 0 ]; then
exit 0
fi
- echo 'JVERSION parameter is missing.'
- exit 1
- name: prepare
image: joomlaprojects/docker-images:php7.4
commands:
- composer install
- git config --global advice.detachedHead false
- |
if [ "$JTYPE" = "framework" ]; then
vendor/bin/robo repos:checkout --fw=$JVERSION
fi
- |
if [ "$JTYPE" = "cms" ]; then
git clone https://github.com/joomla/joomla-cms.git ./repos/joomla-cms
cd repos/joomla-cms
git checkout tags/$JVERSION
fi
- name: generate_documentation
image: phpdoc/phpdoc
volumes:
- name: phpdocumentor-cache
path: /tmp/phpdocumentor-cache
commands:
- |
if [ "$JTYPE" = "framework" ]; then
phpdoc -d "./repos/*/src" -t "./build/framework-$JVERSION/" --cache-folder "/tmp/phpdocumentor-cache" --template "./" --title "Joomla! Framework $JVERSION.x API" -i "./repos/string/src/phputf8" --defaultpackagename "Joomla Framework" --setting=graphs.enabled=true --setting=guides.enabled=true
fi
- |
if [ "$JTYPE" = "cms" ]; then
export MINORVERSION=${JVERSION%.*}
export MAJORVERSION=${JVERSION:0:1}
phpdoc -d "./repos/joomla-cms/libraries/src" -t "./build/cms-$MAJORVERSION/" --cache-folder "/tmp/phpdocumentor-cache" --template "./" --title "Joomla! CMS $MINORVERSION.x API" --defaultpackagename "Joomla CMS" --setting=graphs.enabled=true --setting=guides.enabled=true
fi
- name: deploy_documentation
image: joomlaprojects/docker-images:packager
environment:
ssh_password:
from_secret: ssh_password
ssh_user:
from_secret: ssh_user
ssh_host:
from_secret: ssh_host
RINGCENTRAL_WEBHOOK:
from_secret: notification_url
commands:
- rclone config create api sftp host $ssh_host user $ssh_user pass $ssh_password port 22 use_insecure_cipher true disable_hashcheck true
- |
if [ "$JTYPE" = "framework" ]; then
rclone sync ./build/framework-$JVERSION/ api:/home/api/public_html/framework-$JVERSION/ -v
fi
- |
if [ "$JTYPE" = "cms" ]; then
export MINORVERSION=${JVERSION%.*}
export MAJORVERSION=${JVERSION:0:1}
rclone sync ./build/cms-$MAJORVERSION/ api:/home/api/public_html/cms-$MAJORVERSION/ -v
fi
- /bin/notify
volumes:
- name: phpdocumentor-cache
host:
path: /tmp/phpdocumentor-cache
trigger:
branch:
- master
event:
- custom
---
kind: signature
hmac: 5c08c08a45e4eb39ec6e5feafd4c86d19b0843acea3ec4752e7ede4220368ffb
...