Skip to content

Commit

Permalink
cleanup old tests and build (#2192)
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitzer authored Jul 21, 2023
1 parent 8e6e7f1 commit c52349d
Show file tree
Hide file tree
Showing 40 changed files with 858 additions and 1,228 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Java CI
name: Build 5.3.7

on: [push, pull_request, workflow_dispatch]

Expand All @@ -22,7 +22,7 @@ jobs:
- 1433:1433
options: --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P ${SA_PASSWORD} -Q 'SELECT 1' || exit 1" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: szenius/set-timezone@v1.0
- uses: szenius/set-timezone@v1.1
with:
timezoneLinux: "UTC"
- uses: actions/checkout@v2
Expand All @@ -32,13 +32,13 @@ jobs:
java-version: '8'
distribution: 'adopt'
- name: Cache Lucee extensions
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/work/Lucee/Lucee/cache/
key: lucee-extensions
restore-keys: lucee-extensions
- name: Cache Maven packages
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('loader/pom.xml','core/pom.xml') }}
Expand All @@ -47,7 +47,7 @@ jobs:
maven-cache
- name: Set up MySQL (local)
run: |
sudo /etc/init.d/mysql start
sudo systemctl start mysql
mysql -e 'CREATE DATABASE lucee' -uroot -proot
mysql -e 'CREATE USER "lucee"@"localhost" IDENTIFIED WITH mysql_native_password BY "lucee";' -uroot -proot
mysql -e 'GRANT ALL PRIVILEGES ON lucee.* TO "lucee"@"localhost"' -uroot -proot
Expand Down Expand Up @@ -86,15 +86,18 @@ jobs:
MSSQL_PORT: 1433
MSSQL_DATABASE: master
S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_ID_TEST }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY_TEST }}
DO_DEPLOY: ${{ github.event_name == 'push' }}
# s3 tests disabled due to LDEV-4474
#S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY_TEST }}
S3_BUCKET_PREFIX: lucee-ldev-5-
# DO_DEPLOY: ${{ github.event_name == 'push' }}
# for uploading successful builds
S3_ACCESS_ID_DOWNLOAD: ${{ secrets.S3_ACCESS_ID_DOWNLOAD }}
S3_SECRET_KEY_DOWNLOAD: ${{ secrets.S3_SECRET_KEY_DOWNLOAD }}
# used by travis-settings.xml
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
CI_DEPLOY_PASSPHRASE: ${{ secrets.CI_DEPLOY_PASSPHRASE }}
LUCEE_DOCKER_FILES_PAT_TOKEN: ${{ secrets.LUCEE_DOCKER_FILES_PAT_TOKEN }}
#run: ant -noinput -buildfile loader/build.xml
run: |
if [ "${{ github.event_name == 'push' }}" == "true" ]; then
Expand All @@ -104,8 +107,11 @@ jobs:
echo "------- Maven Install on ${{ github.event_name }} ---------";
mvn -B -e -f loader/pom.xml clean install
fi
- name: Remove Lucee build artifacts from local maven cache (avoid growing cache)
run: |
rm -rfv ~/.m2/repository/org/lucee/lucee/
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: test/reports/junit-test-results.xml
Expand Down
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"workbench.colorCustomizations": {
"activityBar.background": "#113425",
"titleBar.activeBackground": "#174834",
"titleBar.activeForeground": "#F4FBF8"
}
}
1 change: 1 addition & 0 deletions ant/build-core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,7 @@
<arg value="-f"/>
<arg value="${ant}/upload-to-s3.xml"/>

<jvmarg value="-Dantdir=${ant}"/>
<jvmarg value="-Dbasedir=${baseDir}"/>
<jvmarg value="-Dlucee.base.dir=${temp}/archive/base"/>
<jvmarg value="-Dlucee.web.dir=${temp}/archive/webroot"/>
Expand Down
1 change: 1 addition & 0 deletions ant/run-testcases.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ function mem(type) {
systemOutput("set /test mapping #dateTimeFormat(now())#", true);
setupTestServices = new test._setupTestServices().setup();
// set the testbox mapping
application
Expand Down
156 changes: 36 additions & 120 deletions ant/upload-to-s3.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project default="run" basedir="." name="Lucee">
<project default="run" basedir="." name="LuceeUploadToS3">

<macrodef name="echots">
<attribute name="message"/>
Expand All @@ -17,128 +17,44 @@

<script language="CFML">
<![CDATA[
try{
NL="
";
SystemOutput("inside upload-to-s3.xml",1,1);
src.jar=server.system.properties.luceejar;
src.core=server.system.properties.luceeCore;
src.dir=getDirectoryFromPath(src.jar);
src.jarName=listLast(src.jar,"\/");
src.coreName=listLast(src.core,"\/");
src.version=mid(src.coreName,1,len(src.coreName)-4);
SystemOutput( "inside upload-to-s3.xml", 1, 1 );
// no S3 credentials?
if(isNull(server.system.environment.S3_ACCESS_ID)
|| isNull(server.system.environment.S3_SECRET_KEY)) {
SystemOutput("no S3 credentials defined to upload to S3",1,1);
return;
//throw "no S3 credentials defined to upload to S3";
//trg.dir="";
request.WEBADMINPASSWORD = "webweb";
request.SERVERADMINPASSWORD = "webweb";
// set a password for the admin
try {
admin
action="updatePassword"
type="web"
oldPassword=""
newPassword="#request.WEBADMINPASSWORD#";
}
else {
trg.dir="s3://#server.system.environment.S3_ACCESS_ID_DOWNLOAD#:#server.system.environment.S3_SECRET_KEY_DOWNLOAD#@/lucee-downloads/";
catch(e){} // may exist from previous execution
try {
admin
action="updatePassword"
type="server"
oldPassword=""
newPassword="#request.SERVERADMINPASSWORD#";
}
trg.jar=trg.dir&src.jarName;
trg.core=trg.dir&src.coreName;
// copy jar
SystemOutput("upload #src.jarName# to S3",1,1);
if(fileExists(trg.jar)) fileDelete(trg.jar);
fileCopy(src.jar,trg.jar);
// copy core
SystemOutput("upload #src.coreName# to S3",1,1);
if(fileExists(trg.core)) fileDelete(trg.core);
fileCopy(src.core,trg.core);
// create war
src.warName="lucee-"&src.version&".war";
src.war=src.dir&src.warName;
trg.war=trg.dir&src.warName;
/*
SystemOutput("upload #src.warName# to S3",1,1);
zip action="zip" file=src.war overwrite=true {
// loader
zipparam source=src.jar entrypath="WEB-INF/lib/lucee.jar";
// common files
// zipparam source=commonDir;
// website files
// zipparam source=webDir;
// war files
// zipparam source=warDir;
}
fileCopy(src.war,trg.war);*/
// light
/*src.lightName="lucee-light-"&src.version&".jar";
src.light=src.dir&src.lightName;
trg.light=trg.dir&src.lightName;
createLight(src.jar,src.light,src.version);
fileCopy(src.light,trg.light);*/
// forgebox
// express
}
catch(e){
SystemOutput(serialize(e),1,1);
rethrow;
}
private function createLight(string loader, string trg,version) {
var sep=server.separator.file;
var tmpDir=getDirectoryFromPath(loader);
local.tmpLoader=tmpDir&"lucee-loader-"&createUniqueId(); // the jar
if(directoryExists(tmpLoader)) directoryDelete(tmpLoader,true);
directoryCreate(tmpLoader);
// unzip
zip action="unzip" file=loader destination=tmpLoader;
// remove extensions
var extDir=tmpLoader&sep&"extensions";
if(directoryExists(extDir))directoryDelete(extDir,true); // deletes directory with all files inside
directoryCreate(extDir); // create empty dir again (maybe Lucee expect this directory to exist)
// unzip core
var lcoFile=tmpLoader&sep&"core"&sep&"core.lco";
local.tmpCore=tmpDir&"lucee-core-"&createUniqueId(); // the jar
directoryCreate(tmpCore);
zip action="unzip" file=lcoFile destination=tmpCore;
// rewrite manifest
var manifest=tmpCore&sep&"META-INF"&sep&"MANIFEST.MF";
var content=fileRead(manifest);
var index=find('Require-Extension',content);
if(index>0) content=mid(content,1,index-1)&variables.NL;
fileWrite(manifest,content);
// zip core
fileDelete(lcoFile);
zip action="zip" source=tmpCore file=lcoFile;
// zip loader
if(fileExists(trg)) fileDelete(trg);
zip action="zip" source=tmpLoader file=trg;
}
catch(e){} // may exist from previous execution
// create "/upload" mapping
admin
action="updateMapping"
type="web"
password="#request.WEBADMINPASSWORD#"
virtual="/upload"
physical="#antdir#"
toplevel="true"
archive=""
primary="physical"
trusted="no";
// do all the actual processing inside an include file so we get useful error messages
include ( template="/upload/upload_to_s3.cfm" );
]]>
</script>
Expand Down
Loading

0 comments on commit c52349d

Please sign in to comment.