forked from talentappstore/tas-tenant-apis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
32 lines (27 loc) · 1.23 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
node {
stage('Checkout') {
startBuildNotification()
checkout scm
dir('tas-des-static') {
git url: 'https://github.com/talentappstore/tas-des-static.git'
}
}
stage('Build') {
env.NODEJS_HOME = "${tool 'tas-des'}"
env.PATH = "${env.NODEJS_HOME}/bin:${env.PATH}"
sh 'tas-des-static/scripts/builddes.sh docs'
}
stage('Deploy') {
withAWS(region: 'ap-southeast-2', credentials: 'terraform-aws-credentials') {
if (env.BRANCH_NAME == 'master') {
s3Upload acl: 'PublicRead', bucket: 'devdocs.talentappstore.com', file: 'docs'
} else if (env.BRANCH_NAME ==~ /\d+\.\d+/) {
s3Upload acl: 'PublicRead', bucket: 'devdocs.talentappstore.com', file: 'docs', path: "v/${env.BRANCH_NAME}"
} else {
s3Upload acl: 'PublicRead', bucket: 'devdocsdev', file: 'docs', path: "${env.BRANCH_NAME}/${env.BUILD_NUMBER}"
echo "https://s3-ap-southeast-2.amazonaws.com/devdocsdev/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/generated/index.html"
}
}
}
}
build job: 'talentappstore/tas-tenant-api-schema/v2_1', parameters: [string(name: 'apiBranch', value: env.BRANCH_NAME)]