Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pipeline {
- agent any
- stages {
- stage('Setup parameters') {
- steps {
- script {
- properties([
- parameters([
- choice(
- choices: ['DEV', 'STAGE', 'PROD'],
- name: 'ENVIRONMENT'
- ),
- booleanParam(
- defaultValue: true,
- description: '',
- name: 'BOOLEAN'
- ),
- text(
- defaultValue: '''
- this is a multi-line
- string parameter example
- ''',
- name: 'MULTI-LINE-STRING'
- ),
- string(
- defaultValue: 'DevOps',
- name: 'JOBROLE',
- trim: true
- )
- ])
- ])
- }
- }
- }
- stage('Deploy to Production') {
- when {
- expression {
- return params.ENVIRONMENT == 'PROD'
- }
- }
- steps {
- sh """
- echo "deploy to production"
- """
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement