Skip to content

Commit

Permalink
Adding new jenkinsfile and modifying output path
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Langlais committed Feb 6, 2019
1 parent 5412b6d commit 6e874cc
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 2 deletions.
52 changes: 52 additions & 0 deletions Jenkinsfile
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/'
}
}
4 changes: 2 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/frontend",
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
Expand Down Expand Up @@ -130,4 +130,4 @@
}
},
"defaultProject": "frontend"
}
}

0 comments on commit 6e874cc

Please sign in to comment.