Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,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..."
}
}