-
Notifications
You must be signed in to change notification settings - Fork 10
325 lines (309 loc) · 10.7 KB
/
Copy pathexpress-template.yml
File metadata and controls
325 lines (309 loc) · 10.7 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
name: Build Lucee Express Templates
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
DRY_RUN:
required: false
default: true
type: boolean
env:
lucee_build_version: 6.2.2.91
DRY_RUN: ${{ github.event.inputs.DRY_RUN }}
jobs:
build-tomcat9-express-template:
runs-on: ubuntu-latest
outputs:
tomcat_version: "${{ steps.save9.outputs.tomcat_version }}"
steps:
- uses: actions/checkout@v4
- name: Download Lucee Jar
run: |
curl --fail https://cdn.lucee.org/lucee-${{ env.lucee_build_version }}.jar -o lucee.jar -s
pwd
ls -lh *.jar
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: lucee-script-runner-maven-cache
- name: Download and configure latest Tomcat 9
id: prepare9
uses: lucee/script-runner@main
with:
webroot: ${{ github.workspace }}/
execute: /download-latest-java-tomcat.cfm
luceeVersion: ${{ env.lucee_build_version }}
env:
express: true
expressTomcatVersion: "9.0"
- name: save tomcat version
id: save9
run: cat tomcat_version.txt >> $GITHUB_OUTPUT
- run: echo '${{ steps.save9.outputs.tomcat_version }}'
- name: Prepare Tomcat 9 Express Template
run: |
pwd
cd lucee/tomcat9/
rm -rf tomcat
cd ../..
pwd
ls -l
mv src-tomcat/linux lucee/tomcat9/tomcat
cp -ar lucee/tomcat9/tomcat-lucee-conf/* lucee/tomcat9/tomcat
cp -a lucee/express-scripts/* lucee/tomcat9/tomcat
ls -lRh
cd lucee/tomcat9/tomcat
zip -r ../../../lucee-tomcat9-template.zip *
cd ../../..
pwd
unzip -l lucee-tomcat9-template.zip
- name: Upload Artifact - Tomcat 9 Express Template
uses: actions/upload-artifact@v4
with:
name: lucee-tomcat9-template
path: lucee-tomcat9-template.zip
retention-days: 1
compression-level: 0
- name: Upload Artifact - lucee fat jar
uses: actions/upload-artifact@v4
with:
name: lucee-fat-jar
path: lucee.jar
retention-days: 1
compression-level: 0
build-tomcat10-express-template:
runs-on: ubuntu-latest
outputs:
tomcat_version: "${{ steps.save10.outputs.tomcat_version }}"
steps:
- uses: actions/checkout@v4
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: lucee-script-runner-maven-cache
- name: Download and configure latest Tomcat 10.1
uses: lucee/script-runner@main
id: prepare10
with:
webroot: ${{ github.workspace }}/
execute: /download-latest-java-tomcat.cfm
luceeVersion: ${{ env.lucee_build_version }}
env:
express: true
expressTomcatVersion: "10.1"
- name: save tomcat version
id: save10
run: cat tomcat_version.txt >> $GITHUB_OUTPUT
- run: echo '${{ steps.save10.outputs.tomcat_version }}'
- name: Prepare Tomcat 10.1 Express Template
run: |
pwd
cd lucee/tomcat9/
rm -rf tomcat
cd ../..
pwd
ls -l
mv src-tomcat/linux lucee/tomcat9/tomcat
cp -ar lucee/tomcat9/tomcat-lucee-conf/* lucee/tomcat9/tomcat
cp -a lucee/express-scripts/* lucee/tomcat9/tomcat
ls -lRh
cd lucee/tomcat9/tomcat
zip -r ../../../lucee-tomcat10_1-template.zip *
cd ../../..
pwd
unzip -l lucee-tomcat10_1-template.zip
- name: Upload Artifact - Tomcat 10.1 Express Template
uses: actions/upload-artifact@v4
with:
name: lucee-tomcat10_1-template
path: lucee-tomcat10_1-template.zip
retention-days: 1
compression-level: 0
build-tomcat11-express-template:
runs-on: ubuntu-latest
outputs:
tomcat_version: "${{ steps.save11.outputs.tomcat_version }}"
steps:
- uses: actions/checkout@v4
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: lucee-script-runner-maven-cache
- name: Download and configure latest Tomcat 11
uses: lucee/script-runner@main
id: prepare11
with:
webroot: ${{ github.workspace }}/
execute: /download-latest-java-tomcat.cfm
luceeVersion: ${{ env.lucee_build_version }}
env:
express: true
expressTomcatVersion: "11.0"
- name: save tomcat version
id: save11
run: cat tomcat_version.txt >> $GITHUB_OUTPUT
- run: echo '${{ steps.save11.outputs.tomcat_version }}'
- name: Prepare Tomcat 11 Express Template
run: |
pwd
cd lucee/tomcat9/
rm -rf tomcat
cd ../..
pwd
ls -l
mv src-tomcat/linux lucee/tomcat9/tomcat
cp -ar lucee/tomcat9/tomcat-lucee-conf/* lucee/tomcat9/tomcat
cp -a lucee/express-scripts/* lucee/tomcat9/tomcat
ls -lRh
cd lucee/tomcat9/tomcat
zip -r ../../../lucee-tomcat11-template.zip *
cd ../../..
pwd
unzip -l lucee-tomcat11-template.zip
- name: Upload Artifact - Tomcat 11 Express Template
uses: actions/upload-artifact@v4
with:
name: lucee-tomcat11-template
path: lucee-tomcat11-template.zip
retention-days: 1
compression-level: 0
test-linux:
runs-on: ubuntu-latest
needs: [build-tomcat9-express-template, build-tomcat10-express-template, build-tomcat11-express-template]
strategy:
matrix:
tomcat: [ tomcat11, tomcat10_1, tomcat9 ]
steps:
- name: Download Linux Express Template
uses: actions/download-artifact@v4
with:
name: lucee-${{matrix.tomcat}}-template
- name: Download test Lucee jar
uses: actions/download-artifact@v4
with:
name: lucee-fat-jar
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
- name: list dir
run: |
ls -l
- name: Run Linux Express Template
run: |
mkdir tomcat
cd tomcat
unzip ../lucee-${{matrix.tomcat}}-template.zip
cd ..
mv lucee.jar tomcat/lib/ext
ls -lR
./tomcat/bin/startup.sh
sleep 5;
echo "<cfscript>if (server.lucee.version neq url.version) header statuscode='500' statustext='wrong version #server.lucee.version#'; echo('## Lucee Linux ' & server.lucee.version & ', using java ' & server.java.version & ' running on ' & server.servlet.name);</cfscript>" > tomcat/webapps/ROOT/check.cfm
curl http://127.0.0.1:8888/check.cfm?version=${{ env.lucee_build_version }} --fail-with-body -o $GITHUB_STEP_SUMMARY
#sleep 5
#sudo /tmp/lucee/lucee_ctl stop
- name: debug failure
if: ${{ failure() }}
run: |
ls -l tomcat/logs/
echo "----- catalina.out"
[ -r tomcat/logs/catalina.out ] && cat tomcat/logs/catalina.out
#cat tomcat/lucee-server/context/logs/out.log
#cat tomcat/lucee-server/context/logs/err.log
#cat tomcat/logs/catalina.out
test-windows:
runs-on: windows-latest
needs: [build-tomcat9-express-template, build-tomcat10-express-template, build-tomcat11-express-template]
strategy:
matrix:
tomcat: [ tomcat11, tomcat10_1, tomcat9 ]
steps:
- name: Download Windows Express Template
uses: actions/download-artifact@v4
with:
name: lucee-${{matrix.tomcat}}-template
- name: Download test Lucee jar
uses: actions/download-artifact@v4
with:
name: lucee-fat-jar
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
- name: list dir
run: |
dir
- name: Run Windows Express Template
shell: cmd
run: |
md tomcat
cd tomcat
unzip ../lucee-${{matrix.tomcat}}-template.zip
cd ..
copy lucee.jar tomcat\lib\ext\lucee.jar
dir tomcat\lib\ext\
dir /s
cd tomcat\bin
call startup.bat
echo force sleeping for 10s
powershell -command "Start-Sleep -s 10"
cd ..\..
pwd
echo "<cfscript>if (server.lucee.version neq url.version) header statuscode='500' statustext='wrong version #server.lucee.version#'; echo('## Lucee Linux ' & server.lucee.version & ', using java ' & server.java.version & ', running on ' & server.servlet.name);</cfscript>" > tomcat\webapps\ROOT\check.cfm
dir tomcat\webapps\ROOT
curl http://127.0.0.1:8888/check.cfm?version=${{ env.lucee_build_version }} --fail-with-body -o %GITHUB_STEP_SUMMARY%
- name: debug failure
if: ${{ failure() }}
shell: cmd
run: |
dir /s
type tomcat\lucee-server\context\logs\exception.log
ECHO catalina.out
cd tomcat/logs
dir /s
for /f "tokens=*" %f in ('dir /b "catalina*.log"') do type "%f"
publish-to-s3:
runs-on: ubuntu-latest
needs: [ test-windows, test-linux, build-tomcat9-express-template, build-tomcat10-express-template, build-tomcat11-express-template ]
env:
S3_ACCESS_ID_DOWNLOAD: ${{ secrets.S3_ACCESS_ID_DOWNLOAD }}
S3_SECRET_KEY_DOWNLOAD: ${{ secrets.S3_SECRET_KEY_DOWNLOAD }}
DRY_RUN: ${{ github.event.inputs.DRY_RUN }}
steps:
- uses: actions/checkout@v4.1.1
- name: Download Tomcat 11 express templates artifact
uses: actions/download-artifact@v4
with:
name: lucee-tomcat11-template
- name: Download Tomcat 10 express templates artifact
uses: actions/download-artifact@v4
with:
name: lucee-tomcat10_1-template
- name: Download Tomcat 9 express templates artifact
uses: actions/download-artifact@v4
with:
name: lucee-tomcat9-template
- name: list dir
run: |
dir
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: lucee-script-runner-maven-cache
- name: Publish Express Template to S3
uses: lucee/script-runner@main
with:
webroot: ${{ github.workspace }}/
execute: /publish-express-template-to-s3.cfm
luceeVersion: ${{ env.lucee_build_version }}
env:
tomcat9_version: ${{ needs.build-tomcat9-express-template.outputs.tomcat_version }}
tomcat10_version: ${{ needs.build-tomcat10-express-template.outputs.tomcat_version }}
tomcat11_version: ${{ needs.build-tomcat11-express-template.outputs.tomcat_version }}