-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindowpipeline
More file actions
41 lines (36 loc) · 1.2 KB
/
windowpipeline
File metadata and controls
41 lines (36 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
40
41
pipeline {
agent any
environment {
GIT_URL = "https://github.com/Development-study/-CI-CD-Study.git"
DOCKERHUB_CREDENTIALS = credentials('docker-hub')
}
stages {
stage('Pull') {
steps {
git url: "${GIT_URL}", branch: "main", poll: true, changelog: true
}
}
stage('Build') {
steps {
echo 'SpringBoot Gradle Project Build'
bat 'gradlew.bat clean build'
}
}
stage('Dockerize') {
steps {
echo 'Docker Image Build And Image Push'
bat 'docker build -t yongbin1/cicd-server:0.0.1 .'
bat 'docker login -u yongbin1 -p jyj10241103*'
bat 'docker push yongbin1/cicd-server:0.0.1'
}
}
stage('Deploy') {
steps {
echo 'Docker Container Run'
bat 'docker ps -q --filter "name=cicd-service" | xargs -r docker stop'
bat 'docker ps -aq --filter "name=cicd-service" | xargs -r docker rm'
bat 'docker run -d --name cicd-service -p 8080:8080 yongbin1/cicd-server:0.0.1'
}
}
}
}