【发布时间】:2022-12-02 08:05:51
【问题描述】:
I want to make it function like when ENVIRONMENT is selected as None Build button should not appear or it should not be clickable or should give error live ENVIRONMENT is required!.
@Library('shared-library@main') _
pipeline {
agent any
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '40', artifactNumToKeepStr: '20'))
}
parameters {
choice(name: 'ENVIRONMENT', choices: ['None','development', 'development2', 'development3', 'development4'], description: 'Environment to be built')
string(name: 'BRANCH', defaultValue: 'intermediate_release_1.21.0', description: 'Branch to be built')
}
stages {
stage('Repo clone') {
steps {
git credentialsId: 'jenkins-automation-github', poll: false, url: 'git@github.com:example/example.git', branch: "${params.BRANCH}"
}
}
stage('Build') {
steps {
script{
APP_NAME= 'XXX'
REPO_NAME= 'XX' + APP_NAME
ACCOUNT_ID= 'XXX'
ENVIRONMENT = params.BRANCH
build(REPO_NAME, ACCOUNT_ID)
}
}
}
}
}
【问题讨论】:
标签: jenkins