-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile
52 lines (45 loc) · 1.97 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
#!/usr/bin/env groovy
node('node.js') {
stage('Setup') {
git branch: "${BRANCH_NAME}",
credentialsId: 'cccddfb1-0cc4-4006-bbc2-ef420f6d1c21',
url: '[email protected]:Open-STEM/FullIDE.git'
properties([
pipelineTriggers([pollSCM('@daily')]),
buildDiscarder(logRotator(numToKeepStr: '20'))
])
}
if (BRANCH_NAME == 'main') {
deployDestination = "${BRANCH_NAME}/${BUILD_NUMBER}".toString()
buildIdentifier = "${BUILD_NUMBER}";
baseUrl = '/'
} else {
deployDestination = BRANCH_NAME.toString()
buildIdentifier = "${BRANCH_NAME}-${BUILD_NUMBER}"
baseUrl = "/versions/${deployDestination}/".toString()
}
stage('Archive to S3') {
bitbucketStatusNotify(buildState: 'INPROGRESS', buildKey: 'archive', buildName: 'Archive to S3')
try {
sh "aws s3 sync ./ s3://xrp-ae-250188540659-fullide/versions/${deployDestination}/ --cache-control no-cache --delete"
bitbucketStatusNotify(buildState: 'SUCCESSFUL', buildKey: 'archive', buildName: 'Archive to S3')
}
catch (Throwable ex) {
bitbucketStatusNotify(buildState: 'FAILED', buildKey: 'archive', buildName: 'Archive to S3')
throw ex
}
}
if (BRANCH_NAME == 'allogy-test') {
stage('Deploy to Test') {
bitbucketStatusNotify(buildState: 'INPROGRESS', buildKey: 'deploy', buildName: 'Deploy to Test')
try {
sh "aws s3 sync s3://xrp-ae-250188540659-fullide/versions/${deployDestination}/ s3://xrp-ae-250188540659-fullide/test/ --delete"
bitbucketStatusNotify(buildState: 'SUCCESSFUL', buildKey: 'deploy', buildName: 'Deploy to Test')
}
catch (Throwable ex) {
bitbucketStatusNotify(buildState: 'FAILED', buildKey: 'deploy', buildName: 'Deploy to Test')
throw ex
}
}
}
}