ci: refs#6706 Jenkinsfile fixes
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2024-02-06 11:40:13 +01:00
parent 4af454edd4
commit 28168130ae
1 changed files with 10 additions and 11 deletions

21
Jenkinsfile vendored
View File

@ -9,6 +9,16 @@ node {
stage('Setup') { stage('Setup') {
env.NODE_ENV = 'dev' env.NODE_ENV = 'dev'
PROTECTED_BRANCH = [
'dev',
'test',
'master'
].contains(env.BRANCH_NAME)
FROM_GIT = env.JOB_NAME.startsWith('gitea/')
RUN_TESTS = !PROTECTED_BRANCH && FROM_GIT
RUN_BUILD = PROTECTED_BRANCH && FROM_GIT
configFileProvider([ configFileProvider([
configFile(fileId: 'salix.properties', configFile(fileId: 'salix.properties',
variable: 'PROPS_FILE') variable: 'PROPS_FILE')
@ -28,21 +38,10 @@ node {
} }
} }
PROTECTED_BRANCH = [
'dev',
'test',
'master'
].contains(env.BRANCH_NAME)
FROM_GIT = env.JOB_NAME.startsWith('gitea/')
RUN_TESTS = !PROTECTED_BRANCH && FROM_GIT
RUN_BUILD = PROTECTED_BRANCH && FROM_GIT
// https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables // https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
echo "Node: ${NODE_NAME}" echo "Node: ${NODE_NAME}"
echo "Workspace: ${WORKSPACE}" echo "Workspace: ${WORKSPACE}"
echo "Debug: ${env.DEBUG}" echo "Debug: ${env.DEBUG}"
echo "Replicas: ${env.BACK_REPLICAS}"
} }
} }
pipeline { pipeline {