29 lines
649 B
Plaintext
29 lines
649 B
Plaintext
|
|
pipeline {
|
||
|
|
agent any
|
||
|
|
|
||
|
|
stages {
|
||
|
|
stage('Checkout') {
|
||
|
|
steps {
|
||
|
|
git url: 'http://<服务器IP>:3000/<用户名>/ChatRoomProject.git', branch: 'master'
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
stage('Build Docker Image') {
|
||
|
|
steps {
|
||
|
|
script {
|
||
|
|
docker.build("chatroom:latest", ".")
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
stage('Deploy to k3s') {
|
||
|
|
steps {
|
||
|
|
sh '''
|
||
|
|
kubectl delete deployment chatroom --ignore-not-found
|
||
|
|
kubectl apply -f k8s-deployment.yaml
|
||
|
|
'''
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|