-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding new jenkinsfile and modifying output path
- Loading branch information
Evan Langlais
committed
Feb 6, 2019
1 parent
5412b6d
commit 6e874cc
Showing
2 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!groovy | ||
|
||
properties( | ||
[ | ||
[$class: 'BuildDiscarderProperty', strategy: | ||
[$class: 'LogRotator', artifactDaysToKeepStr: '14', artifactNumToKeepStr: '5', daysToKeepStr: '30', numToKeepStr: '60']], | ||
pipelineTriggers( | ||
[ | ||
pollSCM('H/1 * * * *'), | ||
// 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('Lint') { | ||
sh 'ng lint' | ||
} | ||
|
||
stage('Build') { | ||
milestone() | ||
sh 'ng build --prod --aot --progress=false' | ||
} | ||
|
||
stage('Archive') { | ||
sh 'tar -cvzf dist.tar.gz --strip-components=1 dist' | ||
archive 'dist.tar.gz' | ||
} | ||
|
||
stage('Deploy') { | ||
milestone() | ||
echo "Deploying..." | ||
sh 'cp -r dist/. /var/www/html/master/' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters