From 2eaebc68c58b1488b6220fa7fe928122b34fc573 Mon Sep 17 00:00:00 2001 From: sunxiaolong Date: Thu, 27 Jun 2024 00:14:41 +0800 Subject: [PATCH] =?UTF-8?q?:rocket:=20=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E6=9E=84=E5=BB=BA=E7=A8=8B=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 24 +++++++++++++++++++ Jenkinsfile.bak | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 Jenkinsfile create mode 100644 Jenkinsfile.bak diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..fde1616 --- /dev/null +++ b/Jenkinsfile @@ -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...' + } + } + } + } +} \ No newline at end of file diff --git a/Jenkinsfile.bak b/Jenkinsfile.bak new file mode 100644 index 0000000..3035f84 --- /dev/null +++ b/Jenkinsfile.bak @@ -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...' + } + } + } + } +} \ No newline at end of file