forked from ssahoo81/samplejava
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathUpload_Jenkinsfile
More file actions
120 lines (109 loc) · 5.05 KB
/
Copy pathUpload_Jenkinsfile
File metadata and controls
120 lines (109 loc) · 5.05 KB
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
def appName='Jenkins_test_app'
def deployName = 'Test'
def dataFormat ='json'
def configFile ='config/**/Component/*.json'
def target ='deployable'
def namePath ="jenkinsTest/${currentBuild.number}"
def commit =false
def validate =true
def convertPath =true
def changesetNumber=""
def snapshotName=''
def fullFileName="${appName}-${deployName}-${currentBuild.number}.${dataFormat}"
def exporterName ='testExporter'
pipeline {
agent any
stages {
stage('Clone repository') {
steps{
// checkout scm
git branch: 'master', url: 'https://github.com/iamkumaramit/samplejava.git'
}
}
stage('Upload Configuration file'){
steps{
script{
sh "echo uploading configuration file ${configFile}"
echo "Test Upload to Component"
changesetNumber = snDevOpsConfigUpload(
applicationName: "${appName}",
deployableName: "${deployName}",
dataFormat: "${dataFormat}",
configFile: "${configFile}",
target:"component",
namePath: "${namePath}",
autoCommit:"${commit}",
autoValidate:"${validate}",
changesetNumber:"${changesetNumber}",
convertPath:"${convertPath}"
)
echo "Test Upload to Deployable"
snDevOpsConfigUpload(
applicationName: "${appName}",
deployableName: "test",
dataFormat: "${dataFormat}",
configFile: "${configFile}",
target:"Deployable",
namePath: "${namePath}",
autoCommit:"${commit}",
autoValidate:"${validate}",
changesetNumber:"${changesetNumber}",
convertPath:"${convertPath}"
)
echo "Test Upload to Collection"
snDevOpsConfigUpload(
applicationName: "${appName}",
dataFormat: "${dataFormat}",
configFile: "${configFile}",
target: "collection",
collectionName: "testCollection1",
namePath: "${namePath}",
autoCommit:"${commit}",
autoValidate:"${validate}",
changesetNumber:"${changesetNumber}",
convertPath:"${convertPath}"
)
echo "Test Upload to Collection vars"
snDevOpsConfigUpload(
applicationName: "${appName}",
dataFormat: "${dataFormat}",
configFile: "collectionsVar.json",
target:"collection",
collectionName:"testCollection1",
namePath: "vars/${currentBuild.number}",
autoCommit:"${commit}",
autoValidate:"${validate}",
changesetNumber:"${changesetNumber}",
convertPath:"${convertPath}"
)
echo "Test Upload to Component vars"
snDevOpsConfigUpload(
applicationName: "${appName}",
dataFormat: "${dataFormat}",
configFile: "componentsVar.json",
target:"component",
namePath: "vars/${currentBuild.number}",
autoCommit:"${commit}",
autoValidate:"${validate}",
changesetNumber:"${changesetNumber}",
convertPath:"${convertPath}"
)
echo "Test Upload to deployable vars"
snDevOpsConfigUpload(
applicationName: "${appName}",
deployableName: "preprod",
dataFormat: "${dataFormat}",
configFile: "deployablesVar.json",
target:"deployable",
namePath: "vars/${currentBuild.number}",
autoCommit:true,
autoValidate:"${validate}",
changesetNumber:"${changesetNumber}",
convertPath:"${convertPath}"
)
echo "Upload result $changesetNumber"
}
}
}
}
}