-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile-basic
69 lines (66 loc) · 2 KB
/
Jenkinsfile-basic
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env groovy
def gv
pipeline {
agent any
parameters {
string (name: 'VERSION', defaultValue: '', description: 'version to deploy on prod server')
choice (name: 'VERSION', choices: ['1.1', '1.2', '1.3'], description: 'paramter type is choice for demo purposes-- mention the desc here')
booleanParam(name: 'executeTests', defaultValue: true, description: 'demo for boolean params')
}
stages {
stage('init') {
steps {
script {
gv = load "script.groovy"
}
}
}
stage('build') {
steps {
script {
gv.buildApp( )
}
}
}
stage('test') {
when {
expression {
params.executeTests
}
}
steps {
script {
gv.testApp()
}
}
}
stage('deploy') {
input {
<<<<<<< HEAD
message "Select the env to deplot to: "
ok "Env selected"
parameters {
choice (name: 'ENV', choices: ['dev.1', 'test', '1.staging', 'prod'], description: '')
=======
message "Select the env to deploy to: "
ok "Env selected"
parameters {
choice (name: 'ONE', choices: ['dev', 'test', 'staging', 'prod'], description: '')
choice (name: 'TWO', choices: ['dev', 'test', 'staging', 'prod'], description: '')
>>>>>>> 36c50b6cb24e9549518a45f9c295574a5d9d7c24
}
}
steps {
script {
gv.deployApp()
<<<<<<< HEAD
echo "deploying to ${ENV}"
=======
echo "deploying to ${ONE}"
echo "deploying to ${TWO}"
>>>>>>> 36c50b6cb24e9549518a45f9c295574a5d9d7c24
}
}
}
}
}