🚀 添加自动化构建程序

This commit is contained in:
sunxiaolong
2024-06-27 00:14:41 +08:00
parent db8c97f780
commit 2eaebc68c5
2 changed files with 86 additions and 0 deletions

24
Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,24 @@
pipeline {
agent none
stages {
stage('Build Image With localhost') {
agent { label 'LocalHost' } // 在标签为'linux-build'的节点上执行
steps {
script {
try {
echo 'Start Build'
sh 'docker compose -f docker-compose.yaml up -d --build'
echo 'Build success'
} catch (err) {
echo err.getMessage()
}
}
}
post { // 添加post指令处理阶段完成后的情况
failure {
echo 'Build failed, but continuing to the next stage...'
}
}
}
}
}

62
Jenkinsfile.bak Normal file
View File

@@ -0,0 +1,62 @@
pipeline {
agent none
stages {
stage('Build Image With localhost') {
agent { label 'LocalHost' } // 在标签为'linux-build'的节点上执行
steps {
script {
try {
echo 'Start Build'
sh 'docker compose -f docker-compose.yaml up -d --build'
echo 'Build success'
} catch (err) {
echo err.getMessage()
}
}
}
post { // 添加post指令处理阶段完成后的情况
failure {
echo 'Build failed, but continuing to the next stage...'
}
}
}
stage('Build Image With rabbit') {
agent { label '流氓兔' } // 在标签为'linux-build'的节点上执行
steps {
script {
try {
echo 'Start Build'
sh 'docker compose -f docker-compose.yaml up -d --build'
echo 'Build success'
} catch (err) {
echo err.getMessage()
}
}
}
post { // 添加post指令处理阶段完成后的情况
failure {
echo 'Build failed, but continuing to the next stage...'
}
}
}
stage('Build Image With L') {
agent { label 'L' } // 在标签为'linux-build'的节点上执行
steps {
script {
try {
echo 'Start Build'
sh 'docker compose -f docker-compose.yaml up -d --build'
echo 'Build success'
} catch (err) {
echo err.getMessage()
}
}
}
post { // 添加post指令处理阶段完成后的情况
failure {
echo 'Build failed, but continuing to the next stage...'
}
}
}
}
}