Restart on swarm!

This commit is contained in:
Artur Kuś 2025-08-15 07:28:11 +02:00
parent d18625a452
commit 7d60421528
1 changed files with 10 additions and 9 deletions

View File

@ -1,12 +1,13 @@
pipeline { pipeline {
agent any agent any
stages {
stages{ stage('Restart Swarm services') {
stage('restart docker') { steps {
steps { sh '''
# Restart wszystkich usług poza jenkinsem
sh("docker ps -q | grep -v \$(docker ps -qf 'name=jenkins') | xargs docker restart"); docker service ls --format "{{.Name}}" | grep -v 'jenkins' | xargs -I {} docker service update --force {}
} '''
} }
} }
}
} }