I am not able to echo A or B or C when using condition in parallel block. I have used choice params for it.
It work when I am using global params but I want to use it in under one stage.
Pipeline:
pipeline {
agent any
parameters {
choice choices: ['Dev', 'QA'], description: 'Make a choice', name: 'CLICK'
}
stages {
stage('Dev') {
when { expression { params.CLICK == 'DEV' } }
steps {
echo "Dev"
}
}
stage('QA') {
when { expression { params.CLICK == 'QA' } }
input {
message "Choose appropriate Test?"
parameters {
choice choices: ['MobileAPP', 'FrontEnd', 'BankEnd'], description: 'Make a choice', name: 'CLICK1'
}
}
parallel {
stage('A') {
when {
expression { params.CLICK == 'MobileAPP' }
}
steps {
echo "A"
}
}
stage('B') {
when {
expression { params.CLICK == 'FrontEnd' }
}
steps {
echo "B"
}
}
stage('C') {
when {
expression { params.CLICK == 'BackEnd' }
}
steps {
echo "C"
}
}
}
}
}
}
Wrong output: