-
Notifications
You must be signed in to change notification settings - Fork 9
220 lines (207 loc) · 7.87 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
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
DRY_RUN:
required: false
default: false
type: boolean
repository_dispatch:
types: [build-installers]
env:
LUCEE_INSTALLER_VERSION: ${{ github.event.inputs.LUCEE_VERSION }}
IB_URL: https://releases.installbuilder.com/installbuilder/installbuilder-enterprise-24.3.0-linux-x64-installer.run
IB_NAME: installbuilder-enterprise-24.3.0-linux-x64-installer.run
lucee_build_version: 6.1.1.60-SNAPSHOT
jobs:
build-installers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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_INSTALLER_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_INSTALLER_VERSION }}.jar -o lucee-${{ env.LUCEE_INSTALLER_VERSION }}.jar -s
pwd
ls -l
mv lucee-${{ env.LUCEE_INSTALLER_VERSION }}.jar lucee/lucee/lib/
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: lucee-script-runner-maven-cache
- name: Download latest Tomcat and Java
uses: lucee/script-runner@main
with:
webroot: ${{ github.workspace }}/
execute: /download-latest-java-tomcat.cfm
luceeVersion: ${{ env.lucee_build_version }}
- name: Prepare Tomcat Linux
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
ls -lRh
- name: Build Lucee Installer - Linux x64
run: |
cd lucee
/tmp/ib/bin/builder build lucee.xml linux-x64 --verbose --license license.xml
- name: Prepare Tomcat Windows
run: |
cd lucee/tomcat9/
rm -rfv tomcat
cd ../..
pwd
ls -l
mv src-tomcat/windows lucee/tomcat9/tomcat
cp -ar lucee/tomcat9/tomcat-lucee-conf/* lucee/tomcat9/tomcat
ls -lRh
- 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_INSTALLER_VERSION }}-linux-x64-installer.run --version
out=`/tmp/ib/output/lucee-${{ env.LUCEE_INSTALLER_VERSION }}-linux-x64-installer.run --version`
tet="Lucee ${{ env.LUCEE_INSTALLER_VERSION }}"
if [[ $out != $tet* ]]
then
echo Incorrect version banner
exit 1
fi
- name: Upload Artifact - Linux Installer
uses: actions/upload-artifact@v4
with:
name: lucee-installer-${{ env.LUCEE_INSTALLER_VERSION }}-linux-run
path: /tmp/ib/output/*.run
retention-days: 1
compression-level: 0
- name: Upload Artifact - Windows Installer
uses: actions/upload-artifact@v4
with:
name: lucee-installer-${{ env.LUCEE_INSTALLER_VERSION }}-windows
path: /tmp/ib/output/*.exe
retention-days: 1
compression-level: 0
test-linux:
runs-on: ubuntu-latest
needs: build-installers
steps:
- name: Download Linux Installer artifact
uses: actions/download-artifact@v4
with:
name: lucee-installer-${{ env.LUCEE_INSTALLER_VERSION }}-linux-run
- name: list dir
run: |
ls -l
- name: Run Linux installer
run: |
ls -l
chmod +x lucee-${{ env.LUCEE_INSTALLER_VERSION }}-linux-x64-installer.run
sudo ./lucee-${{ env.LUCEE_INSTALLER_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_INSTALLER_VERSION }} --fail-with-body -o $GITHUB_STEP_SUMMARY
#sleep 5
#sudo /tmp/lucee/lucee_ctl stop
- name: debug failure
if: ${{ failure() }}
run: |
ls -l /tmp
cd /tmp/lucee
ls -lR
echo "installbuilder_installer.log"
cat /tmp/installbuilder_installer.log
echo "install.log"
cat /tmp/lucee/install.log
ls -l /tmp/lucee/tomcat/logs/
#cat /tmp/lucee/tomcat/logs/catalina.out
#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@v4
with:
name: lucee-installer-${{ env.LUCEE_INSTALLER_VERSION }}-windows
- name: list dir
run: |
dir
- name: Run Windows Installer
shell: cmd
run: |
cd
lucee-${{ env.LUCEE_INSTALLER_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_INSTALLER_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 ]
if: ${{ github.event.inputs.DRY_RUN != true }}
env:
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@v4
with:
name: lucee-installer-${{ env.LUCEE_INSTALLER_VERSION }}-windows
- name: Download Linux Installer artifact
uses: actions/download-artifact@v4
with:
name: lucee-installer-${{ env.LUCEE_INSTALLER_VERSION }}-linux-run
- name: Cache Maven packages
uses: actions/cache@v4
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.lucee_build_version }}