-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy path12_Parameters.groovy
More file actions
30 lines (29 loc) · 967 Bytes
/
12_Parameters.groovy
File metadata and controls
30 lines (29 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// This is for Parameters example
pipeline {
agent any
parameters {
// string , text, booleanParam, choice, password
string(name: 'PERSON', defaultValue: 'Mr Jenkins', description: 'Who should I say hello to?')
string (name: 'BRANCH_NAME', defaultValue: "main", description: 'Whats the branch i should build??')
booleanParam( // true, false
name: 'TOOGLE',
defaultValue: true,
description: 'toogle this value'
)
choice(
name: 'ENV',
choices: ['dev', 'tst', 'stg', 'prd'],
description: 'Select the env u want to deploy'
)
}
stages {
stage ('Example') {
steps {
echo "Hello ${params.PERSON}"
echo "Boolean parameter is: ${params.TOOGLE}"
echo "Deploying to ${params.ENV} environment"
}
}
}
}
// Complex..... Input + parameters ....