init commit
parent
cfdcd8b49e
commit
f99a686342
|
|
@ -1,9 +1,13 @@
|
|||
def loopEnvironments(environments){
|
||||
environments.each { entry --> echo "${name}"}
|
||||
|
||||
}
|
||||
pipeline {
|
||||
options {
|
||||
ansiColor('xterm')
|
||||
}
|
||||
//label libraryBuild is available in CN JAWS and ROW JAWS, therefore this one was used; no additional intents
|
||||
agent{label 'libraryBuild'}
|
||||
agent {label 'libraryBuild'}
|
||||
|
||||
|
||||
//here comes the trigger according to crontabs - jenkins is in UTC
|
||||
|
|
@ -55,14 +59,14 @@
|
|||
//Define how to
|
||||
// could also be a script block instead of a when block
|
||||
//e.g. add an additional parameter to python scripts to let python choose on which environment it should execute the script (not that good, as the script should be as generic as possible)
|
||||
//e.g. just put the execute script step in both steps (not that good --> do not repeat yourself)
|
||||
//e.g. create to environment.yaml files and use different files for different jenkins (not that good --> ugly)
|
||||
//is the environment yaml even that good, should python be refactored to only execute one environment at time
|
||||
//e.g. just put the execute python script step in both steps (not that good --> do not repeat yourself)
|
||||
//e.g. create two environment.yaml files and use different files for different jenkins (not that good --> ugly)
|
||||
//e.g. is the environment yaml even that good, should python be refactored to only execute one environment at time
|
||||
|
||||
|
||||
stage('Detect Jenkins Environment CN') {
|
||||
when {
|
||||
expression { return env.JENKINS_URL ==~ 'china' }
|
||||
expression { return env.JENKINS_URL == 'https://jaws-china.bmwgroup.net/opmaas/' }
|
||||
}
|
||||
steps {
|
||||
|
||||
|
|
@ -78,7 +82,9 @@
|
|||
expression { return env.JENKINS_URL == 'https://jaws.bmwgroup.net/opapm/' }
|
||||
}
|
||||
steps {
|
||||
sh 'echo "test" > test.csv'
|
||||
script{environments = readYaml (file:'environment.yaml')}
|
||||
sh 'echo "test" > test.csv'
|
||||
loopEnvironments(environments)
|
||||
//env.JENKINS_URL
|
||||
//env.BRANCH_NAME
|
||||
print env.JENKINS_URL
|
||||
|
|
|
|||
Loading…
Reference in New Issue