Deploy to Firebase (#11)

This commit is contained in:
Billy Brawner 2018-09-04 10:14:46 -05:00 committed by Gitea
parent 12f7edc581
commit df1a66dc70
4 changed files with 28 additions and 10 deletions

5
.firebaserc Normal file
View file

@ -0,0 +1,5 @@
{
"projects": {
"default": "budget-c7da5"
}
}

4
.gitignore vendored
View file

@ -38,3 +38,7 @@ testem.log
.DS_Store
Thumbs.db
*.swp
*~
# Firebase
.firebase/

13
Jenkinsfile vendored
View file

@ -27,16 +27,9 @@ pipeline {
}
}
steps {
sshPut remote: remote, from: 'archive.zip', into: '.'
sshCommand remote: remote, command: """
if [ test -d /var/www/budget.wbrawner.com/revisions/$GIT_COMMIT ]; then rm -rf /var/www/budget.wbrawner.com/revisions/$GIT_COMMIT; fi && \
mkdir -p /var/www/budget.wbrawner.com/revisions/$GIT_COMMIT && \
unzip -d /var/www/budget.wbrawner.com/revisions/$GIT_COMMIT /root/archive.zip && \
rm /root/archive.zip && \
if [ test -L /var/www/budget.wbrawner.com/html ]; then unlink /var/www/budget.wbrawner.com/html; fi && \
ln -s /var/www/budget.wbrawner.com/revisions/$GIT_COMMIT /var/www/budget.wbrawner.com/html && \
if [ \$(ls /var/www/budget.wbrawner.com/revisions | wc -l) -gt 5 ]; then ls -t /var/www/budget.wbrawner.com/revisions | tail -n +5 | xargs rm -rf; fi
"""
withCredentials([string(credentialsId: '4a0b8908-75eb-4bc3-9961-db044f848bc5', variable: 'FIREBASE_DEPLOY_TOKEN')]) {
sh 'firebase deploy --token "$FIREBASE_DEPLOY_TOKEN"'
}
}
}
stage('Deploy to Dev') {

16
firebase.json Normal file
View file

@ -0,0 +1,16 @@
{
"hosting": {
"public": "dist/budget",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}