jenkins: fixup pipeline into multibranch structure

This commit is contained in:
2026-02-24 02:08:15 -06:00
parent 4b8cac97ad
commit 00804e0a30
Vendored
+18 -8
View File
@@ -1,4 +1,11 @@
pipeline {
agent none
stages {
stage('Main') {
when {
beforeAgent true
branch 'main'
}
agent { label 'agent-12' }
stages {
stage('Checkout') {
@@ -20,28 +27,31 @@ pipeline {
}
}
}
}
pipeline {
}
stage('Testing') {
when {
beforeAgent true
not { branch 'main' }
}
agent { label 'agent-13' }
stages {
stage('Checkout') {
stage('Test Checkout') {
steps {
checkout scm
}
}
stage('Build') {
stage('Test Build') {
steps {
script {
docker.build('trianta.dev:latest')
docker.build('test.trianta.dev:latest')
}
}
}
stage('Deploy') {
stage('Test Deploy') {
steps {
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'
}
}
}
}
}