ChatingRoomProject/Jenkinsfile

29 lines
649 B
Plaintext
Raw Normal View History

2025-09-17 08:38:41 +00:00
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
'''
}
}
}
}