-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
36 lines (34 loc) · 1.02 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
pipeline {
agent {
//label 'masterNode'
label 'searchslave'
}
stages {
stage('Build') {
steps {
sh 'sudo usermod -a -G docker $USER || true'
//sh 'sudo docker swarm init || true'
sh 'sudo docker stack rm pythonserver || true'
sh 'sudo docker rmi scatpythonserver:latest || true'
}
}
stage('Test') {
steps {
sh 'sudo docker stack deploy -c docker-compose-postgres.yml postgres'
sh 'echo "Sleeping for 3minutes"'
sh 'sleep 180'
sh 'sudo docker build -t scatpythonserver .'
}
}
stage('Deploy') {
steps {
script{
sh 'sudo docker stack deploy -c docker-compose.yml pythonserver'
// withEnv(['JENKINS_NODE_COOKIE=dontKillMe']) {
// sh "docker-compose up -d"
// }
}
}
}
}
}