jenkins: fixup pipeline into multibranch structure

This commit is contained in:
2026-02-24 02:08:15 -06:00
parent 4b8cac97ad
commit 00804e0a30
Vendored
+17 -7
View File
@@ -1,4 +1,11 @@
pipeline { pipeline {
agent none
stages {
stage('Main') {
when {
beforeAgent true
branch 'main'
}
agent { label 'agent-12' } agent { label 'agent-12' }
stages { stages {
stage('Checkout') { stage('Checkout') {
@@ -21,23 +28,25 @@ pipeline {
} }
} }
} }
stage('Testing') {
pipeline { when {
beforeAgent true
not { branch 'main' }
}
agent { label 'agent-13' } agent { label 'agent-13' }
stages { stage('Test Checkout') {
stage('Checkout') {
steps { steps {
checkout scm checkout scm
} }
} }
stage('Build') { stage('Test Build') {
steps { steps {
script { script {
docker.build('trianta.dev:latest') docker.build('test.trianta.dev:latest')
} }
} }
} }
stage('Deploy') { stage('Test Deploy') {
steps { steps {
sh 'docker stop test.trianta.dev && docker rm test.trianta.dev || exit 0' sh 'docker stop test.trianta.dev && docker rm test.trianta.dev || exit 0'
sh 'docker run -d -e USER=scv -e USER_UID=1001-e USER_GID=1001 --restart=unless-stopped -p 3466:80 --name test.trianta.dev test.trianta.dev:latest' sh 'docker run -d -e USER=scv -e USER_UID=1001-e USER_GID=1001 --restart=unless-stopped -p 3466:80 --name test.trianta.dev test.trianta.dev:latest'
@@ -45,3 +54,4 @@ pipeline {
} }
} }
} }
}