feat: switch to multi instance automated by jenkins
All checks were successful
jenkins-ci Build successful
All checks were successful
jenkins-ci Build successful
This commit is contained in:
12
Jenkinsfile
vendored
12
Jenkinsfile
vendored
@@ -1,9 +1,14 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
parameters {
|
||||
choice(name: 'USER_NAME', choices: ['lucas', 'cyrus'], description: 'Quelle instance déployer ?')
|
||||
}
|
||||
|
||||
environment {
|
||||
GITEA_REPO_PATH = "lucas/uptime-kuma"
|
||||
GITEA_API_URL = "https://gitea.lucasroyer.fr/api/v1"
|
||||
DOCKER_HOST = "unix:///run/user/1001/docker.sock"
|
||||
}
|
||||
|
||||
stages {
|
||||
@@ -14,8 +19,11 @@ pipeline {
|
||||
}
|
||||
stage('Deploy') {
|
||||
steps {
|
||||
echo "Deploy new kuma..."
|
||||
sh "docker compose up -d --remove-orphans"
|
||||
echo "Deploy new kuma for ${params.USER_NAME}..."
|
||||
sh """
|
||||
USER_NAME=${params.USER_NAME} \
|
||||
docker compose -p ${params.USER_NAME} up -d --force-recreate --remove-orphans
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
services:
|
||||
uptime-kuma:
|
||||
image: louislam/uptime-kuma:2.0.2-slim
|
||||
container_name: uptime-kuma
|
||||
container_name: uptime-kuma-${USER_NAME}
|
||||
restart: always
|
||||
volumes:
|
||||
- uptime_kuma_data:/app/data
|
||||
- uptime-kuma-data:/app/data
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
networks:
|
||||
- reverse-proxy
|
||||
|
||||
volumes:
|
||||
uptime_kuma_data:
|
||||
external: true
|
||||
uptime-kuma-data:
|
||||
|
||||
networks:
|
||||
reverse-proxy:
|
||||
|
||||
Reference in New Issue
Block a user