-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile
More file actions
39 lines (39 loc) · 1.2 KB
/
Jenkinsfile
File metadata and controls
39 lines (39 loc) · 1.2 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
38
39
pipeline{
agent any
tools{
gradle 'Gradle 8.5'
}
stages{
stage('Build'){
steps{
checkout scmGit(branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/CHISANW/message-board']])
bat 'gradle clean build'
}
}
stage('Docker build image'){
steps{
script{
bat 'docker build -t keuye0638/board_springboot:1.0 .'
}
}
}
stage('Docker hub image'){
steps{
script{
withCredentials([string(credentialsId: 'dockerpwd', variable: 'dockerpwd')]) {
bat "docker login -u keuye0638 -p $dockerpwd"
}
bat 'docker push keuye0638/board_springboot:1.0'
}
}
}
stage('Docker run Cotainier'){
steps{
script{
bat 'docker rm -f board-con || true'
bat ' docker run -d -p 8000:8080 --network testServer --name board-con keuye0638/board_springboot:1.0'
}
}
}
}
}