Skip to content

Commit

Permalink
Make it possible to target different hostings
Browse files Browse the repository at this point in the history
for staging and production in order to test changes on
streambot.bp42.com. Note: The API URL is still api.betterplace.org for
both hostings, just the javascript deployed to firebase is different.
  • Loading branch information
flori committed Jun 26, 2024
1 parent 31db424 commit 9295ac8
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 14 deletions.
12 changes: 12 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"projects": {
"default": "betterplacestreambot"
},
"targets": {
"betterplacestreambot": {
"hosting": {
"production": [
"betterplacestreambot"
],
"staging": [
"bp42streambot"
]
}
}
}
}
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,12 @@ start: setup
build: setup src/**/*
yarn build

deploy: build
firebase deploy

deploy-staging: build
firebase deploy --only hosting:bp42streambot

deploy-production: build
firebase deploy --only hosting:betterplacestreambot

deploy:
@echo Deploy to staging/production with targets deploy-staging/deploy-production respectively.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,17 +225,27 @@ Customization parameters:

## Build & Deploy

Enter

```
$ make deploy-staging
```

or

```
$ make deploy
$ make deploy-production
```

to deploy the current revision.

In case of error 401:

```
$ firebase login --reauth
```

The latest deployed version can then be seen via these URLs:
The latest deployed revision can then be seen via these URLs:

- https://streambot.bp42.com/fundraising-events/30943/standard
- https://streambot.betterplace.org/fundraising-events/30943/standard
Expand Down
42 changes: 32 additions & 10 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
{
"hosting": {
"public": "build",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
"hosting": [
{
"target": "production",
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"target": "staging",
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
]
}

0 comments on commit 9295ac8

Please sign in to comment.