🚀 添加自动化构建程序
This commit is contained in:
24
Jenkinsfile
vendored
Normal file
24
Jenkinsfile
vendored
Normal 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
62
Jenkinsfile.bak
Normal 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...'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user