-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathJenkinsfile
58 lines (50 loc) · 1.4 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
54
55
56
57
58
#!groovy
properties(
[
[$class: 'BuildDiscarderProperty', strategy:
[$class: 'LogRotator', artifactDaysToKeepStr: '14', artifactNumToKeepStr: '5', daysToKeepStr: '30', numToKeepStr: '60']],
pipelineTriggers(
[
pollSCM('H/15 * * * *'),
cron('@daily'),
]
)
]
)
node {
stage('Checkout') {
//disable to recycle workspace data to save time/bandwidth
deleteDir()
checkout scm
//enable for commit id in build number
//env.git_commit_id = sh returnStdout: true, script: 'git rev-parse HEAD'
//env.git_commit_id_short = env.git_commit_id.take(7)
//currentBuild.displayName = "#${currentBuild.number}-${env.git_commit_id_short}"
}
stage('NPM Install') {
withEnv(["NPM_CONFIG_LOGLEVEL=warn"]) {
sh 'npm install'
}
}
stage('Test') {
withEnv(["CHROME_BIN=/usr/bin/chromium-browser"]) {
sh 'ng test --progress=false --watch false'
}
junit '**/test-results.xml'
}
stage('Lint') {
sh 'ng lint'
}
stage('Build') {
milestone()
sh 'ng build --prod --aot --sm --progress=false'
}
stage('Archive') {
sh 'tar -cvzf dist.tar.gz --strip-components=1 dist'
archive 'dist.tar.gz'
}
stage('Deploy') {
milestone()
echo "Deploying..."
}
}