-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
33 lines (28 loc) · 984 Bytes
/
Copy pathJenkinsfile
File metadata and controls
33 lines (28 loc) · 984 Bytes
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
pipeline {
agent any
environment {
GEMINI_KEY = credentials('gemini-api-key-id')
APP_NAME = "house-predict"
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Build & Deploy') {
steps {
script {
echo "--- Quét sạch mọi container trùng tên để dẹp đường ---"
// Lệnh này sẽ xóa thẳng tay các container nếu chúng tồn tại, bất kể thuộc project nào
echo "--- Đang dọn dẹp và khởi chạy hệ thống ---"
// Dùng với biến môi trường từ Jenkins
withCredentials([string(credentialsId: 'gemini-api-key-id', variable: 'GEMINI_KEY')]) {
// Truyền GEMINI_KEY vào GOOGLE_API_KEY cho docker-compose
'sh docker-compose -f docker-compose.yaml up -d --build --force-recreate'
}
}
}
}
}
}