forked from sannrao/web-api
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathJenkinsfileLocalTest
130 lines (105 loc) · 4.84 KB
/
JenkinsfileLocalTest
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/**
* Parameters can be sent via build parameters, instead of changing the code.
* Use the same variable name to set the build parameters.
* List of parameters that can be passed
* appName='devops-demo-web-app'
* deployableName = 'Prod-US'
* componentName="web-app-v1.1"
* collectionName="release-1.0"
* exportFormat ='yaml'
* configFilePath = "k8s/helm/values.yml"
* exporterName ='returnAllData'
* exporterArgs = ''
*/
pipeline {
agent any
/**
* Jenkins pipline related variables
*/
stages{
stage('Initialize'){
steps{
script{
dockerImageName = "santoshnrao/web-app"
/**
* DevOps Config App related information
*/
appName='PaymentDemo'
deployableName = 'Prod-US'
componentName="paymentService-v1.1"
collectionName="release-1.0"
/**
* Configuration File information to be uploade
*/
exportFormat ='yaml'
configFilePath = "k8s/demo-training-studio/values.yml"
/**
* Devops Config exporter related information
*/
exporterName ='returnAllData-nowPreview'
exporterArgs = ''
/**
* Jenkins variables declared to be used in pipeline
*/
fileNamePrefix ='exported_file_'
fullFileName="${fileNamePrefix}-${deployableName}-${currentBuild.number}.${exportFormat}"
changeSetId=""
snapshotName=""
dockerImageTag=""
snapName=''
snapshotObject=""
isSnapshotCreated=false
isSnapshotValidateionRequired=false
isSnapshotPublisingRequired=false
/**
* Checking for parameters
*/
if(params){
echo "setting values from build parameter"
if(params.appName){
appName = params.appName;
}
if(params.deployableName){
deployableName = params.deployableName
}
if(params.componentName){
componentName = params.componentName
}
if(params.collectionName){
collectionName = params.collectionName
}
if(params.exportFormat){
exportFormat = params.exportFormat
}
if(params.configFilePath){
configFilePath = params.configFilePath
}
if(params.exporterName){
exporterName = params.exporterName
}
if(params.exporterArgs){
exporterArgs = params.exporterArgs
}
}
}
}
}
stage("Test Stage") {
steps {
script {
echo "Test Stage"
echo " ++++++++++++ BEGIN OF File Content ***************"
sh "ls -l"
echo " ++++++++++++ END OF File content ***************"
}
}
}
}
post{
always{
echo ">>>>>Displaying post info"
// junit '**/*.xml'
junit 'tests/garbage.xml'
}
}
}