Jenkinsfile compatability with main
Gitea Scan/plate-tool/pipeline/head There was a failure building this commit Details

This commit is contained in:
Emilia Allison 2024-01-30 20:49:27 -05:00
parent 984bbda0c1
commit 1f213f47e8
Signed by: emilia
GPG Key ID: 05D5D1107E5100A1
1 changed files with 13 additions and 2 deletions

15
Jenkinsfile vendored
View File

@ -2,11 +2,22 @@ pipeline {
agent any
stages {
stage('Setup') {
if (env.BRANCH_NAME == 'main') {
environment {
OUTPUT_DIR = 'plate-tool'
}
} else {
environment {
OUTPUT_DIR = 'plate-tool-beta'
}
}
}
stage('Build') {
steps {
sh '''
. "$HOME/.cargo/env"
trunk build --release --public-url "cool-stuff/plate-tool-beta/"
trunk build --release --public-url "cool-stuff/$OUTPUT_DIR/"
'''
}
}
@ -24,7 +35,7 @@ pipeline {
stage('Deploy') {
steps {
sh '''
ssh oracle "sudo rm -rf /usr/share/nginx/html/plate-tool-beta/ && sudo mv dist /usr/share/nginx/html/plate-tool-beta"
ssh oracle "sudo rm -rf /usr/share/nginx/html/$OUTPUT_DIR/ && sudo mv dist /usr/share/nginx/html/$OUTPUT_DIR"
'''
}
}