-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path.drone.yml
More file actions
148 lines (134 loc) · 4.48 KB
/
Copy path.drone.yml
File metadata and controls
148 lines (134 loc) · 4.48 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
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
138
139
140
141
142
143
144
145
146
147
148
---
kind: pipeline
name: deploy_static_assets
clone:
steps:
- name: prepare_package
image: joomlaprojects/docker-images:packager
environment:
FTP_KEY:
from_secret: ftp_key
FTP_USER:
from_secret: ftp_user
FTP_HOST:
from_secret: ftp_host
MATTERMOST_NIGHTLY_HOOK:
from_secret: mattermost_nightly_hook
commands:
- mkdir build
- cp -r -v archived.html css/ images/ img/ js/ index.html results.html robots.txt 403.html 404.html .htaccess ./build
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- echo "$FTP_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-add
- rclone config create api sftp host $FTP_HOST user $FTP_USER port 22
- rclone copy ./build/ api:/home/api/public_html -v
- curl -i -X POST -H 'Content-Type:application/json' -d '{"text":"api.joomla.org Deployment for assets was successfull."}' $MATTERMOST_NIGHTLY_HOOK
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 "./.phpdoc/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 "./.phpdoc/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:
FTP_KEY:
from_secret: ftp_key
FTP_USER:
from_secret: ftp_user
FTP_HOST:
from_secret: ftp_host
MATTERMOST_NIGHTLY_HOOK:
from_secret: mattermost_nightly_hook
commands:
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- echo "$FTP_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-add
- rclone config create api sftp host $FTP_HOST user $FTP_USER port 22
- |
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
- curl -i -X POST -H 'Content-Type:application/json' -d '{"text":"API Build for [Joomla ${MINORVERSION}](https://api.joomla.org/cms-${MAJORVERSION}) successfully built."}' $MATTERMOST_NIGHTLY_HOOK
volumes:
- name: phpdocumentor-cache
host:
path: /tmp/phpdocumentor-cache
trigger:
branch:
- master
event:
- custom
---
kind: signature
hmac: 67087323497814e16bc3178c5c4bd9a792c848753058015b6dc094aecd127f84
...