chore: new volume name, add server config and jenkins support
All checks were successful
jenkins-ci Build successful

This commit is contained in:
2026-01-26 11:44:47 +00:00
parent 0e58e22732
commit 704abb4564
4 changed files with 70 additions and 5 deletions

1
.gitignore vendored
View File

@@ -1 +0,0 @@
/etc

59
Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,59 @@
pipeline {
agent any
environment {
GITEA_REPO_PATH = "lucas/ntfy"
GITEA_API_URL = "https://gitea.lucasroyer.fr/api/v1"
}
stages {
stage('Check git...') {
steps {
checkout scm
}
}
stage('Deploy') {
steps {
withCredentials([
file(credentialsId: 'ntfy-env', variable: 'APP_ENV_PATH'),
]) {
echo "Deploy new ntfy..."
sh """
cp "\$APP_ENV_PATH" app.env
docker compose up -d --remove-orphans
rm -f app.env
"""
}
}
}
}
post {
always {
script {
echo "Send Gitea check..."
// Get and store SHA
def commitSha = sh(script: 'git rev-parse HEAD', returnStdout: true).trim()
// Convert from Jenkins to Gitea API
def buildState = (currentBuild.currentResult == 'SUCCESS') ? 'success' : 'failure'
def buildDesc = (currentBuild.currentResult == 'SUCCESS') ? 'Build successful' : 'Build failed'
// Send it to Gitea API with secret 'gitea-token'
withCredentials([string(credentialsId: 'gitea-token', variable: 'GITEA_TOKEN')]) {
// Use \$TOKEN to avoid jenkins to print token in logs
sh """
curl -f -X POST "${GITEA_API_URL}/repos/${GITEA_REPO_PATH}/statuses/${commitSha}" \
-H "Authorization: token \$GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"state": "${buildState}", "target_url": "${env.BUILD_URL}", "description": "${buildDesc}", "context": "jenkins-ci"}'
"""
}
}
echo "Clean unused image..."
sh "docker image prune -f"
}
success { echo "Success !" }
failure { echo "Failed." }
}
}

View File

@@ -6,16 +6,15 @@ services:
command:
- serve
volumes:
- ntfy_cache:/var/cache/ntfy
- ./etc:/etc/ntfy
- cache:/var/cache/ntfy
- /home/lucas/services/ntfy/etc:/etc/ntfy
env_file:
- ntfy.env
networks:
- reverse-proxy
volumes:
ntfy_cache:
external: true
cache:
networks:
reverse-proxy:

8
etc/server.yml Normal file
View File

@@ -0,0 +1,8 @@
# Public adress
base-url: "https://ntfy.lucasroyer.fr"
# Messages storage
cache-file: "/var/cache/ntfy/cache.db"
# Access only to registered users
auth-default-access: "deny-all"