Merge branch 'helma-🐜' into renovate/major-jetty-packages
# Conflicts: # .github/workflows/release.yml
This commit is contained in:
commit
b1296fb093
9 changed files with 177 additions and 184 deletions
42
.github/actions/ssh/action.yml
vendored
Normal file
42
.github/actions/ssh/action.yml
vendored
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
name: SSH setup
|
||||||
|
description: Set up the SSH agent
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
config:
|
||||||
|
description: The SSH configuration
|
||||||
|
required: true
|
||||||
|
key:
|
||||||
|
description: The private SSH key
|
||||||
|
required: true
|
||||||
|
known-hosts:
|
||||||
|
description: The list of known hosts
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Configure SSH
|
||||||
|
shell: sh
|
||||||
|
env:
|
||||||
|
CONFIG: ${{ inputs.config }}
|
||||||
|
KNOWN_HOSTS: ${{ inputs.known-hosts }}
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
echo "${CONFIG}" > ~/.ssh/config
|
||||||
|
echo "${KNOWN_HOSTS}" > ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
- name: Start SSH agent
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
SOCKET: /tmp/ssh-agent.sock
|
||||||
|
run: |
|
||||||
|
echo "SSH_AUTH_SOCK=${SOCKET}" >> $GITHUB_ENV
|
||||||
|
ssh-agent -a ${SOCKET} > /dev/null
|
||||||
|
|
||||||
|
- name: Add SSH key
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
KEY: ${{ inputs.key }}
|
||||||
|
run: |
|
||||||
|
ssh-add - <<< "${KEY}"
|
26
.github/workflows/deploy.yml
vendored
Normal file
26
.github/workflows/deploy.yml
vendored
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
name: Deploy (Production)
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch: {}
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- helma-🐜
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
environment:
|
||||||
|
name: p3k.org
|
||||||
|
url: https://blog.p3k.org
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Set up SSH agent
|
||||||
|
uses: antville/helma/.github/actions/ssh@helma-🐜
|
||||||
|
with:
|
||||||
|
config: ${{ vars.SSH_CONFIG }}
|
||||||
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
known-hosts: ${{ vars.SSH_KNOWN_HOSTS }}
|
||||||
|
|
||||||
|
- name: Copy files to production server
|
||||||
|
run: ssh staging-server deploy-helma
|
10
.github/workflows/release.yml
vendored
10
.github/workflows/release.yml
vendored
|
@ -12,6 +12,10 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
LC_TIME: en_US.UTF-8
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
@ -28,16 +32,14 @@ jobs:
|
||||||
run: ./gradlew assembleDist
|
run: ./gradlew assembleDist
|
||||||
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
run: |
|
||||||
gh release create "$GITHUB_REF_NAME" \
|
gh release create "$GITHUB_REF_NAME" \
|
||||||
--repo "$GITHUB_REPOSITORY" \
|
--repo "$GITHUB_REPOSITORY" \
|
||||||
--title "Helma $GITHUB_REF_NAME" \
|
--title "$(date +'%d %b %Y')" \
|
||||||
--generate-notes
|
--generate-notes
|
||||||
|
|
||||||
- name: Upload assets
|
- name: Upload assets
|
||||||
run: |
|
run: |
|
||||||
gh release upload "$GITHUB_REF_NAME" \
|
gh release upload "$GITHUB_REF_NAME" \
|
||||||
build/distributions/helma-*.*
|
build/distributions/helma-*.* \
|
||||||
--clobber
|
--clobber
|
||||||
|
|
48
.github/workflows/stage.yml
vendored
Normal file
48
.github/workflows/stage.yml
vendored
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
name: Deploy (Staging)
|
||||||
|
|
||||||
|
on: workflow_dispatch
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
stage:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
environment:
|
||||||
|
name: stage
|
||||||
|
url: https://antville-test.click
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up SSH agent
|
||||||
|
uses: ./.github/actions/ssh
|
||||||
|
with:
|
||||||
|
config: ${{ vars.SSH_CONFIG }}
|
||||||
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
known-hosts: ${{ vars.SSH_KNOWN_HOSTS }}
|
||||||
|
|
||||||
|
- 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: Publish to staging server
|
||||||
|
run: |
|
||||||
|
rsync ./build/install/helma/ staging-server:./ \
|
||||||
|
--verbose --archive --delete --compress \
|
||||||
|
--filter '+ /bin' \
|
||||||
|
--filter '+ /extras' \
|
||||||
|
--filter '+ /launcher.jar' \
|
||||||
|
--filter '- /lib/ext' \
|
||||||
|
--filter '+ /lib' \
|
||||||
|
--filter '+ /modules' \
|
||||||
|
--filter '- /*'
|
||||||
|
|
||||||
|
- name: Restart Helma
|
||||||
|
run: ssh staging-server restart
|
50
.github/workflows/staging.yml
vendored
50
.github/workflows/staging.yml
vendored
|
@ -1,50 +0,0 @@
|
||||||
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
|
|
3
.vscode/extensions.json
vendored
3
.vscode/extensions.json
vendored
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"recommendations": [
|
"recommendations": [
|
||||||
"vscjava.vscode-java-pack"
|
"vscjava.vscode-java-pack",
|
||||||
|
"vscjava.vscode-gradle"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
84
.vscode/launch.json
vendored
84
.vscode/launch.json
vendored
|
@ -1,84 +0,0 @@
|
||||||
{
|
|
||||||
// Use IntelliSense to learn about possible attributes.
|
|
||||||
// Hover to view descriptions of existing attributes.
|
|
||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"type": "java",
|
|
||||||
"name": "Current File",
|
|
||||||
"request": "launch",
|
|
||||||
"mainClass": "${file}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "java",
|
|
||||||
"name": "ImageInfo",
|
|
||||||
"request": "launch",
|
|
||||||
"mainClass": "helma.image.ImageInfo",
|
|
||||||
"projectName": "helma_"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "java",
|
|
||||||
"name": "CommandlineRunner",
|
|
||||||
"request": "launch",
|
|
||||||
"mainClass": "helma.main.CommandlineRunner",
|
|
||||||
"projectName": "helma_"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "java",
|
|
||||||
"name": "Server",
|
|
||||||
"request": "launch",
|
|
||||||
"mainClass": "helma.main.Server",
|
|
||||||
"projectName": "helma_"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "java",
|
|
||||||
"name": "XmlConverter",
|
|
||||||
"request": "launch",
|
|
||||||
"mainClass": "helma.objectmodel.dom.XmlConverter",
|
|
||||||
"projectName": "helma_"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "java",
|
|
||||||
"name": "Crypt",
|
|
||||||
"request": "launch",
|
|
||||||
"mainClass": "helma.util.Crypt",
|
|
||||||
"projectName": "helma_"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "java",
|
|
||||||
"name": "HtmlEncoder",
|
|
||||||
"request": "launch",
|
|
||||||
"mainClass": "helma.util.HtmlEncoder",
|
|
||||||
"projectName": "helma_"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "java",
|
|
||||||
"name": "Logo",
|
|
||||||
"request": "launch",
|
|
||||||
"mainClass": "helma.util.Logo",
|
|
||||||
"projectName": "helma_"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "java",
|
|
||||||
"name": "MarkdownProcessor",
|
|
||||||
"request": "launch",
|
|
||||||
"mainClass": "helma.util.MarkdownProcessor",
|
|
||||||
"projectName": "helma_"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "java",
|
|
||||||
"name": "Commandline",
|
|
||||||
"request": "launch",
|
|
||||||
"mainClass": "helma.main.launcher.Commandline",
|
|
||||||
"projectName": "launcher"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "java",
|
|
||||||
"name": "Main",
|
|
||||||
"request": "launch",
|
|
||||||
"mainClass": "helma.main.launcher.Main",
|
|
||||||
"projectName": "launcher"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
12
README.md
12
README.md
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
## TL;DR
|
## TL;DR
|
||||||
|
|
||||||
- Make sure you have Java 17 or higher installed
|
- Make sure you have Java 11 or higher installed
|
||||||
- Download and unpack the [latest release](https://github.com/antville/helma/releases)
|
- Download and unpack the [latest release](https://github.com/antville/helma/releases)
|
||||||
- Invoke `./bin/helma`, resp. `./bin/helma.bat`, depending on your platform
|
- Invoke `./bin/helma`, resp. `./bin/helma.bat`, depending on your platform
|
||||||
- Direct your web browser to <http://localhost:8080>
|
- Direct your web browser to <http://localhost:8080>
|
||||||
|
@ -21,9 +21,9 @@ Although Helma became a Grande Dame of server-side JavaScript already decades ag
|
||||||
|
|
||||||
## System Requirements
|
## System Requirements
|
||||||
|
|
||||||
You need a Java virtual machine version 17 or higher to run Helma.
|
You need a Java virtual machine version 11 or higher to run Helma.
|
||||||
|
|
||||||
Please consult the documentation of your platform on how to obtain and install Java.
|
Please consult the documentation of your platform how to obtain and install Java.
|
||||||
|
|
||||||
You also can directly download a [Java runtime or development kit](https://www.oracle.com/java/technologies/javase-downloads.html#javasejdk) from Oracle.
|
You also can directly download a [Java runtime or development kit](https://www.oracle.com/java/technologies/javase-downloads.html#javasejdk) from Oracle.
|
||||||
|
|
||||||
|
@ -33,10 +33,12 @@ Helma is built with [Gradle](https://gradle.org), the build task depends on the
|
||||||
|
|
||||||
### Additional Prerequisites
|
### Additional Prerequisites
|
||||||
|
|
||||||
* [Rsync](https://rsync.samba.org) version ≥ 3.1.0
|
|
||||||
* [Node.js](https://nodejs.org) LTS version
|
* [Node.js](https://nodejs.org) LTS version
|
||||||
|
* [Rsync](https://rsync.samba.org) version ≥ 3.1.0
|
||||||
|
|
||||||
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`.
|
Clone this repository to your machine and run Helma with `./gradlew run`.
|
||||||
|
|
||||||
|
To update the installation from a build, run `./gradlew update` and enter `yes` at the prompt.
|
||||||
|
|
||||||
> ⚠️
|
> ⚠️
|
||||||
> 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.
|
> 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.
|
||||||
|
|
86
build.gradle
86
build.gradle
|
@ -17,17 +17,15 @@ def textFiles = ['**/*.hac', '**/.html', '**/*.js', '**/*.md', '**/*.properties'
|
||||||
allprojects {
|
allprojects {
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
|
|
||||||
compileJava {
|
sourceCompatibility = JavaVersion.VERSION_11
|
||||||
sourceCompatibility = JavaVersion.VERSION_17
|
targetCompatibility = JavaVersion.VERSION_11
|
||||||
targetCompatibility = JavaVersion.VERSION_17
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
version = new Date().format("yyyyMMdd")
|
version = new Date().format("yy.M.d")
|
||||||
|
|
||||||
tasks.build.dependsOn javadoc, 'jsdoc', 'generateLicenseReport'
|
tasks.build.dependsOn javadoc, 'jsdoc', 'generateLicenseReport'
|
||||||
tasks.compileJava.dependsOn 'processSource'
|
tasks.compileJava.dependsOn 'processSource'
|
||||||
|
@ -58,7 +56,7 @@ configurations {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.google.code.gson:gson:2.10.1'
|
implementation 'com.google.code.gson:gson:2.11.0'
|
||||||
implementation 'commons-codec:commons-codec:1.17.0'
|
implementation 'commons-codec:commons-codec:1.17.0'
|
||||||
implementation 'org.apache.commons:commons-fileupload2-core:2.0.0-M2'
|
implementation 'org.apache.commons:commons-fileupload2-core:2.0.0-M2'
|
||||||
implementation 'org.apache.commons:commons-fileupload2-jakarta:2.0.0-M1'
|
implementation 'org.apache.commons:commons-fileupload2-jakarta:2.0.0-M1'
|
||||||
|
@ -79,6 +77,37 @@ def rhinoJar = configurations.library.files.find { jar ->
|
||||||
jar.name.startsWith('rhino')
|
jar.name.startsWith('rhino')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
run {
|
||||||
|
jvmArgs jettyLogLevel, suppressMacosDockIcon
|
||||||
|
classpath += fileTree(dir: 'lib/ext', include: '*.jar')
|
||||||
|
}
|
||||||
|
|
||||||
|
application {
|
||||||
|
mainClass = 'helma.main.Server'
|
||||||
|
|
||||||
|
applicationDistribution.from(projectDir) {
|
||||||
|
include 'modules/**'
|
||||||
|
include 'LICENSE.md'
|
||||||
|
include 'README.md'
|
||||||
|
include 'start.*'
|
||||||
|
}
|
||||||
|
|
||||||
|
applicationDistribution.from(javadoc.destinationDir) {
|
||||||
|
include '**'
|
||||||
|
into 'docs/javadoc'
|
||||||
|
}
|
||||||
|
|
||||||
|
applicationDistribution.from("${project.buildDir}/docs/jsdoc") {
|
||||||
|
include '**'
|
||||||
|
into 'docs/jsdoc'
|
||||||
|
}
|
||||||
|
|
||||||
|
applicationDistribution.from("${project.buildDir}/reports/dependency-license") {
|
||||||
|
include '**'
|
||||||
|
into 'licenses'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
startScripts {
|
startScripts {
|
||||||
applicationName = 'helma'
|
applicationName = 'helma'
|
||||||
classpath = files('../launcher.jar')
|
classpath = files('../launcher.jar')
|
||||||
|
@ -104,30 +133,6 @@ distributions {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
application {
|
|
||||||
applicationDistribution.from(projectDir) {
|
|
||||||
include 'modules/**'
|
|
||||||
include 'LICENSE.md'
|
|
||||||
include 'README.md'
|
|
||||||
include 'start.*'
|
|
||||||
}
|
|
||||||
|
|
||||||
applicationDistribution.from(javadoc.destinationDir) {
|
|
||||||
include '**'
|
|
||||||
into 'docs/javadoc'
|
|
||||||
}
|
|
||||||
|
|
||||||
applicationDistribution.from("${project.buildDir}/docs/jsdoc") {
|
|
||||||
include '**'
|
|
||||||
into 'docs/jsdoc'
|
|
||||||
}
|
|
||||||
|
|
||||||
applicationDistribution.from("${project.buildDir}/reports/dependency-license") {
|
|
||||||
include '**'
|
|
||||||
into 'licenses'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
distTar {
|
distTar {
|
||||||
dependsOn ':generateLicenseReport', ':javadoc', ':jsdoc'
|
dependsOn ':generateLicenseReport', ':javadoc', ':jsdoc'
|
||||||
|
|
||||||
|
@ -148,19 +153,10 @@ distZip {
|
||||||
|
|
||||||
installDist {
|
installDist {
|
||||||
dependsOn build
|
dependsOn build
|
||||||
|
|
||||||
if (!System.getenv('CI')) {
|
|
||||||
finalizedBy 'update'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
run {
|
|
||||||
classpath = files('launcher.jar')
|
|
||||||
jvmArgs jettyLogLevel, suppressMacosDockIcon
|
|
||||||
}
|
}
|
||||||
|
|
||||||
task processSource(type: Sync) {
|
task processSource(type: Sync) {
|
||||||
def date = new Date().format("MMMM dd, yyyy")
|
def date = new Date().format("d MMMM yyyy")
|
||||||
def gitOutput = new ByteArrayOutputStream()
|
def gitOutput = new ByteArrayOutputStream()
|
||||||
|
|
||||||
exec {
|
exec {
|
||||||
|
@ -184,6 +180,8 @@ task processSource(type: Sync) {
|
||||||
}
|
}
|
||||||
|
|
||||||
task update {
|
task update {
|
||||||
|
dependsOn installDist
|
||||||
|
|
||||||
def rsyncArgs = ['--archive', '--filter', '- backups']
|
def rsyncArgs = ['--archive', '--filter', '- backups']
|
||||||
|
|
||||||
def confirm = {
|
def confirm = {
|
||||||
|
@ -293,3 +291,11 @@ task commandLine(type: JavaExec) {
|
||||||
mainClass = 'helma.main.launcher.Commandline'
|
mainClass = 'helma.main.launcher.Commandline'
|
||||||
args '-h', projectDir, function
|
args '-h', projectDir, function
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.register('debug', JavaExec) {
|
||||||
|
group = 'application'
|
||||||
|
main = 'helma.main.Server'
|
||||||
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
|
jvmArgs = ['-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005']
|
||||||
|
classpath += fileTree(dir: 'lib/ext', include: '*.jar')
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue