-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPipelineStages.txt
More file actions
72 lines (66 loc) · 5.79 KB
/
Copy pathPipelineStages.txt
File metadata and controls
72 lines (66 loc) · 5.79 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
//"Build" stage for Jenkins pipeline
## Groovy
##
bat '"%powershell%" -ExecutionPolicy ByPass -File "${env.WORKSPACE}/scripts/checkDirectory.ps1" -DIRECTORY %LOG_FOLDER%'
//"Deployment" for Jenkins pipeline
stage ("Deployment to DEV environment") {
try {
echo "${env.UUID}"
bat '"%powershell%" -ExecutionPolicy ByPass -File "${env.WORKSPACE}/scripts/logfile.ps1"% -comment "Begin Deployment to DEV" -WORKSPACE %WORKSPACE% -buildnumber %build_number% -branchname %branch_name%'
bat '"%powershell%" -ExecutionPolicy ByPass -File %artifact_promote% -pac_type %NXS_PKG% -projectname %PROJECT_NAME% -WORKSPACE %WORKSPACE% -region "DEV" -UUID %UUID% -groupid %MVN_NGROUPID_DEV%'
} catch (err) {
bat '"%powershell%" -ExecutionPolicy ByPass -File "${env.WORKSPACE}/scripts/logfile.ps1"% -comment "End Deployment to DEV; Failure" -WORKSPACE %WORKSPACE% -buildnumber %build_number% -branchname %branch_name%'
bat '"%powershell%" -ExecutionPolicy ByPass -File "${env.WORKSPACE}/scripts/logfile.ps1"% -comment "End Pipeline; Failure" -WORKSPACE %WORKSPACE% -buildnumber %build_number% -branchname %branch_name%'
bat '"%powershell%" -ExecutionPolicy ByPass -File %copy_logs% -copy_file %SRC_LOG% -copy_path %LOG_FOLDER%'
bat '"%powershell%" -ExecutionPolicy ByPass -File %copy_logs% -copy_file %GIT_LOG% -copy_path %LOG_FOLDER%'
throw err
}
}
//"Deployment" for Jenkins pipeline
stage ("Deployment to TEST environment") {
try {
echo "${env.UUID}"
bat '"%powershell%" -ExecutionPolicy ByPass -File "${env.WORKSPACE}/scripts/logfile.ps1"% -comment "Begin Deployment to TEST" -WORKSPACE %WORKSPACE% -buildnumber %build_number% -branchname %branch_name%'
//echo "Deploying files via puppet"
bat '"%powershell%" -ExecutionPolicy ByPass -File %artifact_promote% -pac_type %NXS_PKG% -projectname %PROJECT_NAME% -WORKSPACE %WORKSPACE% -region "TEST" -UUID %UUID% -groupid %MVN_NGROUPID_TEST%'
} catch (err) {
bat '"%powershell%" -ExecutionPolicy ByPass -File "${env.WORKSPACE}/scripts/logfile.ps1"% -comment "End Deployment to TEST; Failure" -WORKSPACE %WORKSPACE% -buildnumber %build_number% -branchname %branch_name%'
bat '"%powershell%" -ExecutionPolicy ByPass -File "${env.WORKSPACE}/scripts/logfile.ps1"% -comment "End Pipeline; Failure" -WORKSPACE %WORKSPACE% -buildnumber %build_number% -branchname %branch_name%'
bat '"%powershell%" -ExecutionPolicy ByPass -File %copy_logs% -copy_file %SRC_LOG% -copy_path %LOG_FOLDER%'
bat '"%powershell%" -ExecutionPolicy ByPass -File %copy_logs% -copy_file %GIT_LOG% -copy_path %LOG_FOLDER%'
throw err
}
bat '"%powershell%" -ExecutionPolicy ByPass -File "${env.WORKSPACE}/scripts/logfile.ps1"% -comment "End Deployment to TEST; Success" -WORKSPACE %WORKSPACE% -buildnumber %build_number% -branchname %branch_name%'
}
//"Automated Acceptance testing" for Jenkins pipeline
if ("${Acceptance_test}".toUpperCase() == "YES")
{
stage ("Automated Acceptance Testing") {
try {
echo "${env.UUID}"
bat '"%powershell%" -ExecutionPolicy ByPass -File "${env.WORKSPACE}/scripts/logfile.ps1"% -comment "Begin Automated Acceptance Testing" -WORKSPACE %WORKSPACE% -buildnumber %build_number% -branchname %branch_name%'
bat '"%SLAVE_MSBUILD%" "%WORKSPACE%/SVM.SpecFlow.Tests/SpecFlow.V%APP_VERSION%.%PROJECT_NAME%.Tests.sln" /p:Configuration=Debug;OutPutPath=%WORKSPACE%/SpecflowArtifacts /t:Clean,Build /fl /flp:logfile=Specflowbuild.log'
bat '"%powershell%" -ExecutionPolicy ByPass -File "%SF_PS%" -WORKSPACE %WORKSPACE% -ProjName %PROJECT_NAME% -VERSION %APP_VERSION%'
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'SpecFlow', reportFiles: '*.html', reportName: 'Specflow report'])
} catch (err) {
bat '"%powershell%" -ExecutionPolicy ByPass -File "${env.WORKSPACE}/scripts/logfile.ps1"% -comment "End Automated Acceptance Testing; Failure" -WORKSPACE %WORKSPACE% -buildnumber %build_number% -branchname %branch_name%'
bat '"%powershell%" -ExecutionPolicy ByPass -File "${env.WORKSPACE}/scripts/logfile.ps1"% -comment "End Pipeline; Failure" -WORKSPACE %WORKSPACE% -buildnumber %build_number% -branchname %branch_name%'
bat '"%powershell%" -ExecutionPolicy ByPass -File %copy_logs% -copy_file %SRC_LOG% -copy_path %LOG_FOLDER%'
bat '"%powershell%" -ExecutionPolicy ByPass -File %copy_logs% -copy_file %GIT_LOG% -copy_path %LOG_FOLDER%'
throw err
}
bat '"%powershell%" -ExecutionPolicy ByPass -File "${env.WORKSPACE}/scripts/logfile.ps1"% -comment "End Automated Acceptance Testing; Success" -WORKSPACE %WORKSPACE% -buildnumber %build_number% -branchname %branch_name%'
//Acceptance testing logs to move to LogStash folder
bat '"%powershell%" -ExecutionPolicy ByPass -File "${env.WORKSPACE}/scripts/checkDirectory.ps1" -DIRECTORY %LOG_FOLDER_AT%'
bat '"%powershell%" -ExecutionPolicy ByPass -File %copy_logs% -copy_file %SRC_SF% -copy_path %LOG_FOLDER_AT%'
bat '"%powershell%" -ExecutionPolicy ByPass -File %copy_logs% -copy_file %SRC_SF_BLD% -copy_path %LOG_FOLDER_AT%'
bat '"%powershell%" -ExecutionPolicy ByPass -File %copy_logs% -copy_file %SRC_SF_TEST% -copy_path %LOG_FOLDER_AT%'
// }
}
}
bat '"%powershell%" -ExecutionPolicy ByPass -File "${env.WORKSPACE}/scripts/logfile.ps1"% -comment "End Pipeline; Success" -WORKSPACE %WORKSPACE% -buildnumber %build_number% -branchname %branch_name%'
bat '"%powershell%" -ExecutionPolicy ByPass -File %copy_logs% -copy_file %SRC_LOG% -copy_path %LOG_FOLDER%'
bat '"%powershell%" -ExecutionPolicy ByPass -File %copy_logs% -copy_file %GIT_LOG% -copy_path %LOG_FOLDER%'
stage ("Clean up workspace") {
bat '"%powershell%" -ExecutionPolicy ByPass -File %delete_folder% -DIRECTORY %DELETE_FOLDER_WS%'
}