This repository was archived by the owner on Jul 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathJenkinsfile
More file actions
45 lines (43 loc) · 1.46 KB
/
Jenkinsfile
File metadata and controls
45 lines (43 loc) · 1.46 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
properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactNumToKeepStr: '5', numToKeepStr: '5']]])
def isMaster = env.BRANCH_NAME == "master"
node {
try {
stage("Checkout") {
checkout scm
sh 'rm -rf internal external'
}
stage("Install") {
sh 'npm install'
}
stage("Lint") {
sh 'npm run lint -s'
}
stage("Build") {
sh 'npm run build -s'
sh 'mv dist external'
}
stage("Build internal") {
sh 'npm run build:internal -s'
sh 'mv dist internal'
}
stage("Archive artifacts") {
sh "git rev-parse --short HEAD > git-commit-id"
writeFile file: 'build-id', text: env.BUILD_NUMBER
archiveArtifacts artifacts: "git-commit-id, build-id, external/**/*, internal/**/*", fingerprint: false
}
stage("Deploy internal") {
if (isMaster) {
ftpPublisher alwaysPublishFromMaster: false, continueOnError: false, failOnError: true, publishers: [
[
configName: 'internal_doc_site',
transfers: [ [removePrefix: 'internal', sourceFiles: 'internal/**/*', excludes: ''] ]
]
]
}
}
currentBuild.result = "SUCCESS"
} catch(e) {
currentBuild.result = "FAILURE"
throw e
}
}