Im trying to add a parallel stage, to a angular build commands.
Trying to change “Build apps” stage, but ${configuration_template}
doesnt get set with the value. However it works without the parallel stage.
here’s a snippet on what was before:
try{
withFolderProperties{
timeout(time: TIMEOUT, unit: "MINUTES") {
node("fnode"){
def new_workspace = "${env.WORKSPACE}/${BRANCH}"
def configuration_template = "${configurationPrefix}-vm"
if (SKIP_LINTING_TESTS == 'false') {
stage('Parallel Lint') {
dir("$new_workspace"){
parallel(
"Lint @fa/core-lib" : {
sh 'ng lint @fa/core-lib'
},
"Lint @fa/domain-lib" : {
sh 'ng lint @fa/domain-lib'
},
"Lint @fa/ui-lib" : {
sh 'ng lint @fa/ui-lib'
},
)
}
}
}
stage('Build apps') {
dir("$new_workspace"){
sh """
node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --configuration=${configuration_template}-en --output-path=dist-en
node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --configuration=${configuration_template}-fr --output-path=dist-fr
mv dist-en/* dist-fr/* dist/fa-presentation
"""
}
}
here’s where Im at:
stage('Build apps') {
dir("$new_workspace"){
timeout(45) {
try {
parallel(
"Build -en" : {
sh 'node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --configuration=${configuration_template}-en --output-path=dist-en'
},
"Build -fr" : {
sh 'node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --configuration=${configuration_template}-fr --output-path=dist-fr'
}
)
} finally {
sh 'mv dist-en/* dist-fr/* dist/fa-presentation'
}
}
}
}
it gets executed as below;
node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --configuration=-en --output-path=dist-en