Skip to content

Commit d6a84b7

Browse files
author
critzo
authored
deploy production tagged website releases to firebase (#451)
* testing firebase deployment * testing firebase deployment * testing firebase deployment * testing firebase deployment * testing firebase deployment * testing firebase deployment * testing firebase deployment * testing firebase deployment * testing firebase deployment * testing firebase deployment * added logo as a resource * testing firebase deploy script change * removed testing category page, updated config.yml changing Gems to Plugins, updated ndt-test layout header * final test to confirm firebase deploy works as a script dpl target * final test to confirm firebase deploy works as a script dpl target * added branches whitelist so travis will build all branches * add all_branches: true * updated .travis.yml to build & push to firebase on release tag, master * updates per reviewer comments
1 parent 04c7c66 commit d6a84b7

File tree

7 files changed

+40
-16
lines changed

7 files changed

+40
-16
lines changed

.firebaserc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"projects": {
3+
"default": "mlab-oti"
4+
},
5+
"targets": {
6+
"mlab-oti": {
7+
"hosting": {
8+
"website": [
9+
"mlab-oti"
10+
]
11+
}
12+
}
13+
}
14+
}

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,4 @@ js/app.js
1919
.vagrant
2020
ubuntu-xenial-16.04-cloudimg-console.log
2121
.jekyll-metadata
22-
_cf_s3_invalidator.yml
23-
_staging_deploy_key
24-
_sandbox_deploy_key
22+
.firebase/

.travis.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
dist: xenial
22
language: ruby
3-
43
env:
54
global:
65
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
76

87
script:
98
- set -e
10-
- $TRAVIS_BUILD_DIR/travis/install_gcloud.sh
9+
- "$TRAVIS_BUILD_DIR/travis/install_gcloud.sh"
1110
- sudo apt-get install -y python3-pip
1211
- sudo python3 -m pip install --upgrade setuptools pip
1312
- sudo python3 -m pip install jupyter nbconvert
13+
- npm install -g firebase-tools
1414
- "./_tests/travis-checks --quick"
1515

1616
deploy:
1717
# Separate deployments to various places based on branch and push type
1818
## - sandbox
1919
- provider: script
2020
skip_cleanup: true
21-
script:
22-
$TRAVIS_BUILD_DIR/travis/activate_service_account.sh SERVICE_ACCOUNT_mlab_sandbox
23-
&& gsutil cp -r $TRAVIS_BUILD_DIR/_site/* gs://website.mlab-sandbox.measurementlab.net/
21+
script: "$TRAVIS_BUILD_DIR/travis/activate_service_account.sh SERVICE_ACCOUNT_mlab_sandbox
22+
&& gsutil cp -r $TRAVIS_BUILD_DIR/_site/* gs://website.mlab-sandbox.measurementlab.net/"
2423
on:
2524
repo: m-lab/website
2625
all_branches: true
@@ -29,20 +28,19 @@ deploy:
2928
## - staging
3029
- provider: script
3130
skip_cleanup: true
32-
script:
33-
$TRAVIS_BUILD_DIR/travis/activate_service_account.sh SERVICE_ACCOUNT_mlab_staging
34-
&& gsutil cp -r $TRAVIS_BUILD_DIR/_site/* gs://website.mlab-staging.measurementlab.net/
31+
script: "$TRAVIS_BUILD_DIR/travis/activate_service_account.sh SERVICE_ACCOUNT_mlab_staging
32+
&& gsutil cp -r $TRAVIS_BUILD_DIR/_site/* gs://website.mlab-staging.measurementlab.net/"
3533
on:
3634
repo: m-lab/website
3735
all_branches: true
3836
condition: "$TRAVIS_BRANCH == master && $TRAVIS_EVENT_TYPE == push"
3937

4038
## - production
4139
- provider: script
42-
script:
43-
$TRAVIS_BUILD_DIR/travis/activate_service_account.sh SERVICE_ACCOUNT_mlab_oti
44-
&& gsutil cp -r $TRAVIS_BUILD_DIR/_site/* gs://website.mlab-oti.measurementlab.net/
4540
skip_cleanup: true
41+
script: "firebase use mlab-oti && firebase deploy --only hosting --token $FIREBASE_TOKEN"
4642
on:
4743
repo: m-lab/website
44+
all_branches: true
45+
condition: "$TRAVIS_BRANCH == master && $TRAVIS_EVENT_TYPE == push"
4846
tags: true

_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ kramdown:
4040
# Display blog posts even if they're future-dated.
4141
future: true
4242

43-
# Gems
44-
gems: ['jekyll-paginate', 'jekyll-feed', 'jekyll-jupyter-notebook']
43+
# Plugins
44+
plugins: ['jekyll-paginate', 'jekyll-feed', 'jekyll-jupyter-notebook']
4545
paginate: 5
4646
paginate_path: "/blog/page/:num"
4747

_layouts/ndt-test.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
layout: ndt-test
3+
---
4+
15
{% assign header = site.data.header-footer-content.header %}
26

37
<!DOCTYPE html>

firebase.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"hosting": {
3+
"public": "_site",
4+
"ignore": [
5+
"firebase.json",
6+
"**/.*",
7+
"**/node_modules/**"
8+
]
9+
}
10+
}

images/mlab-logo.png

3.68 KB
Loading

0 commit comments

Comments
 (0)