-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpipelineTrace.groovy
More file actions
42 lines (28 loc) · 1.4 KB
/
Copy pathpipelineTrace.groovy
File metadata and controls
42 lines (28 loc) · 1.4 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
def startStage(location, buildNumber, buildEnvironment, stage){
echo "** pipelineTrace.startStage::" + stage + "::Start **"
File f = new File(location + "/PAC.log")
def timeStamp = new Date().format('yyyy-MM-dd HH:mm:ss.SSS')
f.append([timeStamp, buildNumber, buildEnvironment].join("; ") + " ::Begin " + stage + '\r\n')
echo "** pipelineTrace.startStage::" + stage + "::Finish **"
}
def endStage(location, buildNumber, buildEnvironment, stage){
echo "** pipelineTrace.endStage::" + stage + "::Start **"
File f = new File(location + "/PAC.log")
def timeStamp = new Date().format('yyyy-MM-dd HH:mm:ss.SSS')
f.append([timeStamp, buildNumber, buildEnvironment].join("; ") + " ::Complete " + stage + '\r\n')
echo "** pipelineTrace.endStage::" + stage + "::Finish **"
}
def output(text){
echo "** pipelineTrace.endStage::" + stage + "::Start **"
File f = new File(location + "/PAC.log")
f.append(text + '\r\n')
echo "** pipelineTrace.endStage::" + stage + "::Finish **"
}
def logError(text){
echo "** pipelineTrace.logError::" + stage + "::Start **"
File f = new File(location + "/PAC.log")
def timeStamp = new Date().format('yyyy-MM-dd HH:mm:ss.SSS')
f.append([timeStamp, buildNumber, buildEnvironment].join("; ") + " ::End " + stage + '\r\n')
echo "** pipelineTrace.logError::" + stage + "::Finish **"
}
return this;