-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathJenkinsfile-windows
86 lines (85 loc) · 3.18 KB
/
Jenkinsfile-windows
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
#!/usr/bin/env groovy
@Library('devrel') _
def complianceEnabled = true;
def pullRequest = env.CHANGE_ID
def pullTarget = env.CHANGE_TARGET
def org = "adoption"
def repoName = "local-setup"
def branchName = env.BRANCH_NAME
def pop = "uswest"
def jobName = "util-local-setup"
def buildDependencyJobs = ""
def dependencyRepos = ""
def dependencyJobs = ""
def quickstartScript = ""
def uiAppName = ""
def uiTestJobName = ""
pipeline {
agent none
options {
buildDiscarder(logRotator(artifactDaysToKeepStr: '1', artifactNumToKeepStr: '1', daysToKeepStr: '5', numToKeepStr: '10'))
}
environment {
COMPLIANCEENABLED = true
CF_AWS_CREDS = credentials('cf_aws_creds')
DEVCLOUD_ARTIFACTORY_CREDS = credentials('devcloud_artifactory_creds')
EXT_GITHUB_CREDS = credentials('external_git_creds')
EXT_ARTIFACTORY_USER_CREDS = credentials('external_artifactory_user_creds')
}
parameters {
string(name: 'BUILD', defaultValue: 'true', description: 'checkout, build, test and/or deploy')
string(name: 'INCREMENT', defaultValue: 'none', description: 'increment version - patch | major | minor')
string(name: 'INCREMENT_DEPENDENCIES', defaultValue: 'false', description: 'point at latest dependencies in develop')
string(name: 'MERGE_MASTER', defaultValue: 'false', description: 'merge to master')
string(name: 'RELEASE', defaultValue: 'false', description: 'release master to production')
string(name: 'SMOKE_TEST', defaultValue: 'false', description: 'run smoketests in production')
}
stages {
stage("Build, Test, and/or Deploy" ) {
when {
allOf { environment name: 'BUILD', value: 'true'; environment name: 'MERGE_MASTER', value: 'false'; environment name: 'INCREMENT', value: 'none'; environment name: 'INCREMENT_DEPENDENCIES', value: 'false'; environment name: 'RELEASE', value: 'false'; environment name: 'SMOKE_TEST', value: 'false'; }
}
agent {
label 'windows2016-raw'
}
steps {
echo "The workspace is ${env.WORKSPACE}"
script {
echo 'Stage Build, Test, Deploy'
bat "dir"
// bat "del /s /q *"
// bat "dir"
def status = powershell(returnStatus: true, script: "cd")
// status = powershell(returnStatus: true, script: "(new-object net.webclient).DownloadFile('https://raw.githubusercontent.com/PredixDev/local-setup/master/setup-windows.bat','setup-windows.bat')")
if (status == 0) {
echo "powershell1 success"
bat "echo %cd%"
bat "dir"
status = powershell(returnStatus: true, script: "${workspace}\\setup-windows.bat")
if (status == 0) {
echo "powershell2 success"
}
else {
echo "powershell2 failed status=${status}"
error("powershell2 failed")
}
}
else {
echo "powershell1 failed"
error("powershell1 failed")
}
}
}
post {
success {
echo "Build, Test, Deploy stage completed successfully"
}
failure {
script {
echo "Build, Test, Deploy stage failed"
}
}
}
}
}
}