properties([parameters([[$class: 'DynamicReferenceParameter', choiceType: 'ET_FORMATTED_HTML', name: 'General', omitValueField: false, randomName: 'choice-parameter-517572555514769', referencedParameters: '', script: [$class: 'GroovyScript', fallbackScript: [classpath: [], oldScript: '', sandbox: false, script: ''], script: [classpath: [], oldScript: '', sandbox: true, script: ''' try { def demoID = new Random().with {(1..15).collect {(('a'..'z')).join('')[ nextInt((('a'..'z')).join('').length())]}.join('')} paramHtml = """
Demo Url will be:
""" }catch(e){ return [e.toString()] } return paramHtml ''']]]])]) pipeline { agent { label 'terraform-slave' } parameters { booleanParam(name: 'refresh', defaultValue: false, description: 'Refresh pipeline properties') } stages { stage('Refresh properties') { steps { script { if (Refresh) { currentBuild.result = 'ABORTED' error('Stopping early…') } } } } stage('TF Plan') { steps { container('terraform') { withCredentials([[ $class: 'AmazonWebServicesCredentialsBinding', credentialsId: "f89b3f7d-23ec-42b9-9687-e4acf01d7507", accessKeyVariable: 'AWS_ACCESS_KEY_ID', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) { sh 'terraform version' sh 'terraform init' //sh 'terraform apply -auto-approve' } } } } } }