ChatingRoomProject/Jenkinsfile

28 lines
762 B
Plaintext
Raw Normal View History

2025-09-17 08:38:41 +00:00
pipeline {
agent any
stages {
stage('Checkout') {
steps {
git url: 'http://8.138.13.251:3000/flyfox/ChatingRoomProject', branch: 'master'
2025-09-17 08:38:41 +00:00
}
}
stage('Build Docker Image') {
steps {
sh 'docker build --pull -t chatroom:latest .'
2025-09-17 08:38:41 +00:00
}
}
stage('Deploy to k3s') {
steps {
sh '''
kubectl delete deployment chatroom-deployment --ignore-not-found=true
kubectl create deployment chatroom-deployment --image=chatroom:latest
kubectl expose deployment chatroom-deployment --type=NodePort --port=3030 --target-port=3030
2025-09-17 08:38:41 +00:00
'''
}
}
}
}