-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile
More file actions
37 lines (36 loc) · 1.05 KB
/
Copy pathJenkinsfile
File metadata and controls
37 lines (36 loc) · 1.05 KB
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
37
pipeline {
agent any
stages {
stage('pull code') {
steps {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '111f9a53-039b-4134-a12a-467af5cfc645', url: 'git@github.com:git-jxj/Test.git']]])
}
}
stage('docker container stop and rm') {
steps {
sh 'docker stop demo && docker rm demo';
}
}
stage('docker images rmi') {
steps {
sh 'docker rmi demo';
}
}
stage('build') {
steps {
sh 'mvn clean package -Dmaven.test.skip=true dockerfile:build'
}
}
//stage('docker build push') {
//steps {
//sh "docker tag demo 49.233.11.217:5000/demo"
//sh "docker push 49.233.11.217:5000/demo"
//}
//}
stage('docker run') {
steps {
sh 'docker run -d -p 8080:8080 --name demo demo'
}
}
}
}