-
Notifications
You must be signed in to change notification settings - Fork 9
229 lines (223 loc) · 8.8 KB
/
main.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
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
name: Build Lucee Installer
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
LUCEE_VERSION:
required: true
type: string
# Triggers the workflow on push or pull request events but only for the master branch
workflow_call:
inputs:
LUCEE_VERSION:
required: true
type: string
repository_dispatch:
types: [build-installers]
env:
LUCEE_VERSION: ${{ github.event.inputs.LUCEE_VERSION }}
JRE_LINUX_URL: https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.21_9.tar.gz
JRE_LINUX_NAME: OpenJDK11U-jre_x64_linux_hotspot_11.0.21_9.tar.gz
JRE_LINUX_DIR: jdk-11.0.21+9
JRE_WIN_URL: https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jdk_x64_windows_hotspot_11.0.21_9.zip
JRE_WIN_NAME: OpenJDK11U-jre_x64_windows_hotspot_11.0.21_9.zip
JRE_WIN_DIR: jdk-11.0.21+9
TOMCAT_LINUX_URL: https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.85/bin/apache-tomcat-9.0.85.tar.gz
TOMCAT_LINUX_NAME: apache-tomcat-9.0.85.tar.gz
TOMCAT_WIN_URL: https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.85/bin/apache-tomcat-9.0.85-windows-x64.zip
TOMCAT_WIN_NAME: apache-tomcat-9.0.85.zip
TOMCAT_DIR: apache-tomcat-9.0.85
IB_URL: https://releases.installbuilder.com/installbuilder/installbuilder-enterprise-23.4.0-linux-installer.run
IB_NAME: installbuilder-enterprise-23.4.0-linux-installer.run
jobs:
build-installers:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Download and Install InstallBuilder
run: |
curl ${{ env.IB_URL }} -o ${{ env.IB_NAME }}
ls -l
chmod a+x ${{ env.IB_NAME }}
echo "running installer...."
./${{ env.IB_NAME }} --prefix /tmp/ib --mode unattended
- name: Update Template with version
run : |
cat lucee/lucee.xml.template | sed -e "s,<version>LUCEE_VERSION</version>,<version>${{ env.LUCEE_VERSION }}</version>," > lucee/lucee.xml
- name: Write out license
env:
INSTALLBUILDER_LICENSE: ${{ secrets.INSTALLBUILDER_LICENSE }}
shell: bash
run: |
echo "$INSTALLBUILDER_LICENSE" >> lucee/license.xml
- name: Download Lucee Jar
run: |
curl --fail https://cdn.lucee.org/lucee-${{ env.LUCEE_VERSION }}.jar -o lucee-${{ env.LUCEE_VERSION }}.jar -s
pwd
ls -l
mv lucee-${{ env.LUCEE_VERSION }}.jar lucee/lucee/lib/
- name: Download JRE Linux
run: |
mkdir linux_jre
cd linux_jre
curl "${{ env.JRE_LINUX_URL }}" -o ${{ env.JRE_LINUX_NAME }} -L
tar zxf ${{ env.JRE_LINUX_NAME }}
ls -l
cp -r ${{ env.JRE_LINUX_DIR }}/* ../jre/jre64-lin/jre/
rm -rf ${{ env.JRE_LINUX_DIR }}
- name: Download JRE Windows
run: |
mkdir win_jre
cd win_jre
curl "${{ env.JRE_WIN_URL }}" -o ${{ env.JRE_WIN_NAME }} -L
unzip ${{ env.JRE_WIN_NAME }}
ls -l
cp -r ${{ env.JRE_WIN_DIR }}/* ../jre/jre64-win/jre/
rm -rf ${{ env.JRE_WIN_DIR }}
- name: Download and prepare Tomcat Linux
run: |
pwd
curl ${{ env.TOMCAT_LINUX_URL }} -o ${{ env.TOMCAT_LINUX_NAME }} -s
ls -l
cd lucee/tomcat9/
rm -rf tomcat
rm -rfv ${{ env.TOMCAT_DIR }}
ls -l
tar zxf ../../${{ env.TOMCAT_LINUX_NAME }}
cd ../..
pwd
mv lucee/tomcat9/${{ env.TOMCAT_DIR }} lucee/tomcat9/tomcat
rm -rf lucee/tomcat9/tomcat/webapps
cp -ar lucee/tomcat9/tomcat-lucee-conf/* lucee/tomcat9/tomcat
- name: Build Lucee Installer - Linux x64
run: |
cd lucee
/tmp/ib/bin/builder build lucee.xml linux-x64 --verbose --license license.xml
- name: Download and prepare Tomcat Windows
run: |
pwd
curl ${{ env.TOMCAT_WIN_URL }} -o ${{ env.TOMCAT_WIN_NAME }} -s
ls -l
cd lucee/tomcat9/
rm -rfv tomcat
rm -rfv ${{ env.TOMCAT_DIR }}
unzip ../../${{ env.TOMCAT_WIN_NAME }}
cd ../..
pwd
mv lucee/tomcat9/${{ env.TOMCAT_DIR }} lucee/tomcat9/tomcat
rm -rf lucee/tomcat9/tomcat/webapps
cp -ar lucee/tomcat9/tomcat-lucee-conf/* lucee/tomcat9/tomcat
- name: Build Lucee Installer - Windows x64
run: |
cd lucee
/tmp/ib/bin/builder build lucee.xml windows-x64 --verbose --license license.xml
- name: check linux installer has correct version
run: |
ls -laht /tmp/ib/output/
/tmp/ib/output/lucee-${{ env.LUCEE_VERSION }}-linux-x64-installer.run --version
out=`/tmp/ib/output/lucee-${{ env.LUCEE_VERSION }}-linux-x64-installer.run --version`
tet="Lucee ${{ env.LUCEE_VERSION }}"
if [[ $out != $tet* ]]
then
echo Incorrect version banner
exit 1
fi
- name: Upload Artifact - Linux Installer
uses: actions/upload-artifact@v3
with:
name: lucee-installer-${{ env.LUCEE_VERSION }}-linux-run
path: /tmp/ib/output/*.run
retention-days: 1
- name: Upload Artifact - Windows Installer
uses: actions/upload-artifact@v3
with:
name: lucee-installer-${{ env.LUCEE_VERSION }}-windows
path: /tmp/ib/output/*.exe
retention-days: 1
test-linux:
runs-on: ubuntu-latest
needs: build-installers
steps:
- name: Download Linux Installer artifact
uses: actions/download-artifact@v3
with:
name: lucee-installer-${{ env.LUCEE_VERSION }}-linux-run
- name: list dir
run: |
ls -l
- name: Run Linux installer
run: |
ls -l
chmod +x lucee-${{ env.LUCEE_VERSION }}-linux-x64-installer.run
sudo ./lucee-${{ env.LUCEE_VERSION }}-linux-x64-installer.run \
--mode unattended --prefix /tmp/lucee --installconn false --installmodcfml false --installiis false --startatboot false \
--luceepass ibtest --systemuser $USER --installjre true
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);</cfscript>" > /tmp/lucee/tomcat/webapps/ROOT/check.cfm
curl http://127.0.0.1:8888/check.cfm?version=${{ env.LUCEE_VERSION }} --fail-with-body -o $GITHUB_STEP_SUMMARY
#sleep 5
#sudo /tmp/lucee/lucee_ctl stop
- name: debug failure
if: ${{ failure() }}
run: |
cat /tmp/lucee/tomcat/logs/catalina.out
#cat /tmp/lucee/install.log
cd /tmp/lucee
ls -lR
#cat /tmp/lucee/tomcat/lucee-server/context/logs/out.log
#cat /tmp/lucee/tomcat/lucee-server/context/logs/err.log
#cat /tmp/lucee/tomcat/logs/catalina.out
test-windows:
runs-on: windows-latest
needs: build-installers
steps:
- name: Download Windows Installer artifact
uses: actions/download-artifact@v3
with:
name: lucee-installer-${{ env.LUCEE_VERSION }}-windows
- name: list dir
run: |
dir
- name: Run Windows Installer
shell: cmd
run: |
cd
lucee-${{ env.LUCEE_VERSION }}-windows-x64-installer.exe --mode unattended --installconn false --installmodcfml false --installiis false --startatboot false --luceepass ibtest --installjre true
curl http://127.0.0.1:8888/index.cfm --fail-with-body -o $GITHUB_STEP_SUMMARY
echo "Lucee Windows installer ${{ env.LUCEE_VERSION }}" >> $GITHUB_STEP_SUMMARY
- name: debug failure
if: ${{ failure() }}
run: |
dir -s $home\
type $home\lucee\tomcat\logs\catalina.out
type $home\lucee\install.log
publish-to-s3:
runs-on: ubuntu-latest
needs: [ test-windows, test-linux, build-installers ]
env:
luceeVersion: 6.0.0.585
S3_ACCESS_ID_DOWNLOAD: ${{ secrets.S3_ACCESS_ID_DOWNLOAD }}
S3_SECRET_KEY_DOWNLOAD: ${{ secrets.S3_SECRET_KEY_DOWNLOAD }}
steps:
- uses: actions/[email protected]
- name: Download Windows Installer artifact
uses: actions/download-artifact@v3
with:
name: lucee-installer-${{ env.LUCEE_VERSION }}-windows
- name: Download Linux Installer artifact
uses: actions/download-artifact@v3
with:
name: lucee-installer-${{ env.LUCEE_VERSION }}-linux-run
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: lucee-script-runner-maven-cache
- name: Publish Installers to S3
uses: lucee/script-runner@main
with:
webroot: ${{ github.workspace }}/
execute: /publish-to-s3.cfm
luceeVersion: ${{ env.luceeVersion }}
extensions:
extensionDir: