-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
53 lines (40 loc) · 1.87 KB
/
Jenkinsfile
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
node('xxxx') {
try{
parameters {
string(name: 'APPSERVER', defaultValue: 'jenkinsnodeexample')
}
withEnv(["GIT_SSL_NO_VERIFY=true",
"PYTHONPATH=E:\\sw_nt\\ArcGIS\\Pro2\\bin\\Python\\envs\\arcgispro-py3\\",
"APRX=fc2ago_wildfire.aprx",
"WGETHOME=E:\\sw_nt\\wget\\bin",
"WRKSPC=E:/sw_nt/jenkins/workspace/waops/fc2ago-wildfire/",
"FCSFILE=layers_for_ago2.txt"
]) {
stage ('SCM prepare'){
deleteDir()
checkout([$class: 'GitSCM', branches: [[name: '${gitTag}']], doGenerateSubmoduleConfigurations: false, extensions: [], gitTool: 'Default', submoduleCfg: [], userRemoteConfigs: [[credentialsId: '607141bd-ef34-4e80-8e7e-1134b7c77176', url: 'https://gogs.data.gov.bc.ca/waops/fc2ago.git']]])
}
stage("Copy Configs to the ${env.ENV} Server and run script to push data to ArcGIS Online") {
timeout(time: 15, unit: 'MINUTES') {
bat '''
set TEMP=%WORKSPACE%
set TMP=%TEMP%
%PYTHONPATH%python.exe fc2ago-cron.py -pwd %agopassword% -path %WRKSPC%%APRX% -fcs %FCSFILE%
'''
}
}
}
} catch (e) {
currentBuild.result = "FAILED"
notifyFailed()
throw e
}
}
def notifyFailed() {
emailext (
subject: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
body: """<html><body><p>FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
<p>Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>"</p></html></body>""",
)
}