jenkins: attempt to fix Jenkinsfile again

This commit is contained in:
2026-02-24 03:08:29 -06:00
parent 00804e0a30
commit 8b2d332d8b
Vendored
+22 -8
View File
@@ -1,19 +1,22 @@
pipeline {
agent none
stages {
stage('Main') {
stage('Checkout') {
when {
beforeAgent true
branch 'main'
}
agent { label 'agent-12' }
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Build') {
when {
beforeAgent true
branch 'main'
}
agent { label 'agent-12' }
steps {
script {
docker.build('trianta.dev:latest')
@@ -21,25 +24,32 @@ pipeline {
}
}
stage('Deploy') {
when {
beforeAgent true
branch 'main'
}
agent { label 'agent-12' }
steps {
sh 'docker stop trianta.dev && docker rm 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 trianta.dev trianta.dev:latest'
}
}
}
}
stage('Testing') {
stage('Test Checkout') {
when {
beforeAgent true
not { branch 'main' }
}
agent { label 'agent-13' }
stage('Test Checkout') {
steps {
checkout scm
}
}
stage('Test Build') {
when {
beforeAgent true
not { branch 'main' }
}
agent { label 'agent-13' }
steps {
script {
docker.build('test.trianta.dev:latest')
@@ -47,11 +57,15 @@ pipeline {
}
}
stage('Test Deploy') {
when {
beforeAgent true
not { branch 'main' }
}
agent { label 'agent-13' }
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'
}
}
}
}
}