diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml new file mode 100644 index 00000000..254d9892 --- /dev/null +++ b/.github/workflows/staging.yml @@ -0,0 +1,50 @@ +name: Staging + +on: + workflow_dispatch + +env: + SSH_AUTH_SOCK: /tmp/ssh-agent.sock + +jobs: + install: + runs-on: ubuntu-latest + + environment: + name: staging + url: https://antville-test.click + + steps: + - uses: actions/checkout@v4 + + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 21 + + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Build with Gradle + run: ./gradlew installDist + + - name: Set up SSH agent + run: | + ssh-agent -a $SSH_AUTH_SOCK > /dev/null + ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}" + mkdir -p ~/.ssh + echo '${{ vars.SSH_CONFIG }}' > ~/.ssh/config + echo '${{ vars.KNOWN_HOSTS }}' > ~/.ssh/known_hosts + + - name: Publish to staging server + run: | + rsync build/install/helma/ antville.dev:/ \ + --verbose --archive --delete --compress \ + --filter '+ launcher.jar' \ + --filter '+ lib' \ + --filter '+ *.jar' \ + --filter '- *' \ + + - name: Restart Helma + run: ssh antville.dev restart diff --git a/README.md b/README.md index a735855f..2a134485 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,9 @@ Helma is built with [Gradle](https://gradle.org), the build task depends on the ### Additional Prerequisites * [Rsync](https://rsync.samba.org) version ≥ 3.1.0 -* [NodeJS](https://nodejs.org) LTS version +* [Node.js](https://nodejs.org) LTS version -Clone this repository to your machine and start the build process with `./gradlew install`. The build script is going to ask you if you want to update the installation, enter `y`. +Clone this repository to your machine and start the build process with `./gradlew install`. The build script is going to ask you if you want to update the installation, enter `yes` or `no`. > ⚠️ > Please be aware that this step is going to overwrite files in the installation directory – escpecially at a later time when there might be substantial changes. Should this happen by accident you find the previous installation in the `backups` directory. diff --git a/build.gradle b/build.gradle index 64281785..68e45638 100644 --- a/build.gradle +++ b/build.gradle @@ -147,7 +147,10 @@ distZip { installDist { dependsOn build - finalizedBy 'update' + + if (!System.getenv('CI')) { + finalizedBy 'update' + } } run { @@ -180,11 +183,11 @@ task processSource(type: Sync) { } task update { - def rsyncArgs = ['--archive', '--exclude', 'backups'] + def rsyncArgs = ['--archive', '--filter', '- backups'] def confirm = { - ant.input(message: 'Update this installation?', validargs: 'y,n', addproperty: 'continue') - return ant.continue == 'y' + ant.input(message: 'Update this installation?', validargs: 'yes,no', addproperty: 'continue') + return ant.continue == 'yes' } onlyIf { confirm() } @@ -195,20 +198,29 @@ task update { mkdir backupDir exec { - // Using rsync instead of a CopyTask because the latter chokes on multi-byte characters + // Create a backup with rsync instead of a CopyTask because the latter chokes on multi-byte characters // See https://github.com/gradle/gradle/issues/789 executable 'rsync' args rsyncArgs args "$projectDir/", backupDir } + + print "Created backup of ${projectDir} in ${backupDir}" } doLast { exec { - // Using rsync instead of installDist task because it does not overwrite the project directory + // Using rsync to selectively update the repo directory executable 'rsync' + args '--delete' args rsyncArgs - args '--exclude', 'bin' + args '--filter', '+ bin/***' + args '--filter', '+ docs/***' + args '--filter', '+ extras/***' + args '--filter', '+ launcher.jar' + args '--filter', '+ lib' + args '--filter', '+ *.jar' + args '--filter', '- *' args "${installDist.destinationDir}/", projectDir } } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d64cd491..e6441136 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1af9e093..b82aa23a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew.bat b/gradlew.bat index 6689b85b..7101f8e4 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/modules/jala/build.gradle b/modules/jala/build.gradle index 18427458..e1ef800f 100644 --- a/modules/jala/build.gradle +++ b/modules/jala/build.gradle @@ -1,5 +1,5 @@ dependencies { - runtimeOnly 'dom4j:dom4j:20040902.021138' + runtimeOnly 'dom4j:dom4j:1.1.3' runtimeOnly 'jaxen:jaxen:1.1-beta-8' runtimeOnly 'net.sf.javamusictag:jid3lib:0.5.4' diff --git a/renovate.json b/renovate.json index d9d640bd..fd76f22d 100644 --- a/renovate.json +++ b/renovate.json @@ -39,6 +39,11 @@ "description": "Group Jetty packages", "matchPackagePrefixes": ["org.eclipse.jetty"], "groupName": "Jetty packages" + }, + { + "description": "Group Lucene packages", + "matchPackagePrefixes": ["org.apache.lucene"], + "groupName": "Lucene packages" } ] }