-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.drone.yml
More file actions
142 lines (130 loc) · 4.38 KB
/
Copy path.drone.yml
File metadata and controls
142 lines (130 loc) · 4.38 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
---
kind: pipeline
name: package
steps:
- name: packager
image: joomlaprojects/docker-images:packager
volumes:
- name: composer-cache
path: /tmp/composer-cache
- name: npm-cache
path: /tmp/npm-cache
- name: fido-cache
path: /drone/src/build/fido/
environment:
HTTP_ROOT: "https://artifacts.joomla.org/drone"
DRONE_PULL_REQUEST: DRONE_PULL_REQUEST
DRONE_COMMIT: DRONE_COMMIT
commands:
- /bin/drone_prepare_package.sh
- name: upload
image: joomlaprojects/docker-images:packager
environment:
package_key:
from_secret: package_key
package_user:
from_secret: package_user
package_host:
from_secret: package_host
package_root:
from_secret: package_root
GITHUB_TOKEN:
from_secret: github_token
commands:
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- echo "$package_key" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-add
- rclone config create package sftp host $package_host user $package_user port 22
- rclone copy ./upload/ package:$package_root/$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST/downloads/$DRONE_BUILD_NUMBER
- /bin/add_github_status.sh "Download" "Prebuilt packages are available for download." "https://artifacts.joomla.org/drone/${DRONE_REPO}/${DRONE_BRANCH}/${DRONE_PULL_REQUEST}/downloads/${DRONE_BUILD_NUMBER}"
volumes:
- name: composer-cache
host:
path: /tmp/composer-cache
- name: fido-cache
host:
path: /tmp/fido-cache
- name: npm-cache
host:
path: /tmp/npm-cache
trigger:
repo:
- joomla/joomla-cms
---
kind: pipeline
name: nightly_build
steps:
- name: prepare
image: joomlaprojects/docker-images:packager
volumes:
- name: composer-cache
path: /tmp/composer-cache
- name: npm-cache
path: /tmp/npm-cache
- name: fido-cache
path: /drone/src/build/fido/
commands:
- composer --version
- mkdir -p transfer
- date +%s > transfer/${DRONE_BRANCH%%-dev}-time.txt
- git rev-parse origin/${DRONE_BRANCH} > transfer/${DRONE_BRANCH%%-dev}.txt
- php build/build.php --remote=origin/${DRONE_BRANCH} --exclude-gzip --disable-patch-packages
- mv build/tmp/packages/* transfer/
- php build/build.php --remote=origin/${DRONE_BRANCH} --exclude-zip --exclude-gzip --exclude-bzip2 --debug-build
- mv build/tmp/packages/* transfer/
- name: upload
image: joomlaprojects/docker-images:packager
environment:
nightly_key:
from_secret: nightly_key
nightly_user:
from_secret: nightly_user
nightly_host:
from_secret: nightly_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 "$nightly_key" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-add
- rclone config create nightly sftp host $nightly_host user $nightly_user port 22
- rclone delete nightly:/home/devj/public_html/nightlies/ --include "Joomla_${DRONE_BRANCH%%-dev}.*"
- rclone delete nightly:/home/devj/public_html/cache/com_content/
- rclone copy ./transfer/ nightly:/home/devj/public_html/nightlies/
- curl -i -X POST -H 'Content-Type:application/json' -d '{"text":"Nightly Build for [Joomla '"${DRONE_BRANCH%%-dev}"'](https://developer.joomla.org/nightly-builds.html) successfully built."}' $MATTERMOST_NIGHTLY_HOOK
- name: buildfailure
image: joomlaprojects/docker-images:packager
environment:
MATTERMOST_NIGHTLY_HOOK:
from_secret: mattermost_nightly_hook
commands:
- curl -i -X POST -H 'Content-Type:application/json' -d '{"text":"Nightly Build for [Joomla '"${DRONE_BRANCH%%-dev}"'](https://developer.joomla.org/nightly-builds.html) FAILED to build."}' $MATTERMOST_NIGHTLY_HOOK
when:
status:
- failure
volumes:
- name: composer-cache
host:
path: /tmp/composer-cache
- name: fido-cache
host:
path: /tmp/fido-cache
- name: npm-cache
host:
path: /tmp/npm-cache
trigger:
event:
- cron
- custom
repo:
- joomla/joomla-cms
---
kind: signature
hmac: b35a8a70b20200d91799b8251df1cae7313c8ca78bd2ccc889c29fb10940d5c8
...