Compare commits

..

8 commits

Author SHA1 Message Date
10b0e0e2b7 Remove Eclipse-specific markers (comments)
All checks were successful
Build / build (push) Successful in 8s
2025-05-25 15:34:44 +00:00
233886c433 Fix compiler warnings with and without Copilot 2025-05-25 15:34:44 +00:00
3f2bf9c3dc
Simplify repository workflows
All checks were successful
Build / build (push) Successful in 31s
* Use deploy workflow for staging, too
* Reduce deploy.sh script
2025-05-25 17:05:05 +02:00
f6668636a9 Replace hard-coded hostname with input 2025-05-24 19:25:08 +00:00
1001b3b503 Replace hard-coded hostname with input 2025-05-24 19:14:30 +00:00
27cdc5104b
Reorganize and refurbish .gitignore file 2025-04-11 20:51:55 +02:00
c4abd27ac7
Make deploy script executable
All checks were successful
Build / build (push) Successful in 11s
2025-04-11 12:41:44 +02:00
6b88318bcd
Fix regression of Java sources not being processed before compiling
All checks were successful
Build / build (push) Successful in 11s
2025-04-11 11:48:32 +02:00
5 changed files with 49 additions and 90 deletions

View file

@ -1,15 +1,39 @@
name: Deploy (Production)
name: Deploy
on: workflow_dispatch
on:
workflow_dispatch:
inputs:
hostname:
description: Hostname
type: string
required: true
default: antville.org
jobs:
deploy:
stage:
runs-on: antville
environment:
name: antville.org
url: https://antville.org
name: production
url: ${{ inputs.hostname }}
steps:
- name: Copy files to production server
run: ssh staging-server deploy-helma
- uses: actions/checkout@v4
- name: Build with Gradle
run: ./gradlew installDist
- name: Copy build files to server
run: |
rsync ./build/install/helma/ ${{ inputs.hostname }}:./ \
--verbose --archive --delete --compress \
--filter '+ /bin' \
--filter '+ /extras' \
--filter '+ /launcher.jar' \
--filter '- /lib/ext' \
--filter '+ /lib' \
--filter '+ /modules' \
--filter '- /*'
- name: Restart Helma
run: ssh ${{ inputs.hostname }} restart

View file

@ -1,32 +0,0 @@
name: Deploy (Staging)
on: workflow_dispatch
jobs:
stage:
runs-on: antville
environment:
name: stage
url: ${{ vars.stage_url }}
steps:
- uses: actions/checkout@v4
- 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

22
.gitignore vendored
View file

@ -1,5 +1,7 @@
# Generally ignore hidden files
.*
# Manage some Codium configuration
.vscode/*
!.vscode
!.vscode/extensions.json
@ -7,22 +9,22 @@
!.vscode/settings.json
!.vscode/tasks.json
build
/apps
# Ignore files created during build or run
/bin
/backups
/db
build
/docs
/extras
/lib
/licenses
/log
# Ignore files managed in src/dist
/*.properties
/apps
/db
/extras
/launcher.jar
/static
/*.properties
# Manage Gradle configuration
!/gradle.properties
/launcher.jar
/passwd
/start.*

View file

@ -147,9 +147,11 @@ installDist {
dependsOn build
}
tasks.register('processSource', Sync) {
def processSource = tasks.register('processSource', Sync) {
def gitOutput = new ByteArrayOutputStream()
outputs.dir "${project.buildDir}/src"
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = gitOutput
@ -164,9 +166,11 @@ tasks.register('processSource', Sync) {
.replaceAll('__builddate__', new Date().format("d MMM yyyy"))
.replaceAll('__commithash__', gitOutput.toString().trim())
.replaceAll('__version__', version)
} into "${project.buildDir}/src"
} into outputs.files.singleFile
}
tasks.compileJava.source = processSource.map { it.outputs.files }
tasks.register('update') {
dependsOn installDist

39
src/dist/extras/deploy.sh vendored Normal file → Executable file
View file

@ -3,50 +3,11 @@
# Use this script as forced command of an authorized SSH key:
# command="/home/helma/extras/deploy.sh" ssh-ed25519 AAAAC3NzaC…
# Define HELMA_HOST and ANTVILLE_HOST in this file
# shellcheck source=/dev/null
. "$HOME"/deploy.env
case "$SSH_ORIGINAL_COMMAND" in
ping)
echo pong
;;
deploy-helma)
rsync ./ "$HELMA_HOST":./ \
--archive --compress --delete --verbose \
--filter '+ /bin' \
--filter '+ /extras' \
--filter '+ /launcher.jar' \
--filter '- /lib/ext' \
--filter '+ /lib' \
--filter '+ /modules' \
--filter '- /*'
printf 'Restarting Helma on HELMA_host… '
ssh "$HELMA_HOST" sudo /bin/systemctl restart helma
;;
deploy-antville)
rsync ./apps/antville/ "$ANTVILLE_HOST":./apps/antville/ \
--archive --compress --delete --verbose \
--filter '+ /claustra' \
--filter '+ /code' \
--filter '+ /compat' \
--filter '+ /i18n' \
--filter '+ /lib' \
--filter '- /*'
rsync ./apps/antville/static/helma/ "$ANTVILLE_HOST":./apps/antville/static/helma/ \
--archive --compress --verbose \
--filter '+ /fonts' \
--filter '+ /formica.html' \
--filter '+ /img' \
--filter '+ /scripts' \
--filter '+ /styles' \
--filter '- /*'
printf 'Restarting Helma on ANTVILLE_host… '
ssh "$ANTVILLE_HOST" sudo /bin/systemctl restart helma
;;
restart)
printf 'Restarting Helma… '
sudo /bin/systemctl restart helma