@@ -10,6 +10,8 @@ all: gen-env up down debug shell setup serve switch-channel test-channel \
1010.DEFAULT_GOAL := up
1111.PHONY : all
1212
13+ FIREBASE_ALIAS ?= default
14+
1315
1416# =================== Development Commands ==================
1517
6870
6971# Test hosting locally with FB emulator
7072emulate :
71- firebase emulators:start --only hosting
73+ firebase emulators:start --only hosting --project ${FIREBASE_ALIAS}
7274
7375
7476# =================== Testing locally from host ==================
@@ -133,7 +135,7 @@ check-links:
133135
134136FLUTTER_BRANCH ?= stable
135137TEST_TARGET_CHANNEL ?= stable
136- FIREBASE_ALIAS ?= default
138+ BUILD_CONFIGS ?= _config.yml
137139BUILD_COMMIT := $(shell git rev-parse --short HEAD)
138140BUILD_TAG = fltbuild
139141BUILD_NAME = tmpbuild
@@ -164,12 +166,13 @@ debug-test:
164166# those will be run on the Github action.
165167# Usage: `DISABLE_TESTS=1 make build-image`
166168build-image :
167- docker build --no-cache -- rm --target builder \
169+ docker build --rm --target builder \
168170 --build-arg FIREBASE_ALIAS=${FIREBASE_ALIAS} \
169171 --build-arg FIREBASE_TOKEN=${FIREBASE_TOKEN} \
170172 --build-arg FLUTTER_BRANCH=${FLUTTER_BRANCH} \
171173 --build-arg DISABLE_TESTS=${DISABLE_TESTS} \
172- --build-arg COMMIT=${BUILD_COMMIT} \
174+ --build-arg BUILD_COMMIT=${BUILD_COMMIT} \
175+ --build-arg BUILD_CONFIGS=${BUILD_CONFIGS} \
173176 --build-arg RUBY_VERSION=${RUBY_VERSION} \
174177 --build-arg NODE_VERSION=${NODE_VERSION} -t ${BUILD_TAG} :${BUILD_COMMIT} .
175178
@@ -205,13 +208,16 @@ else
205208 --json
206209endif
207210
208- STAGE_NAME ?= stage
211+
209212# All in one command to stage your build to a Firebase
210213# channel on your currently selected project
211214# Usage: `make stage STAGE_NAME=foo`
215+ STAGE_NAME ?= docs
212216stage :
213- make build
214- firebase hosting:channel:deploy ${STAGE_NAME}
217+ make build BUILD_CONFIGS=_config.yml,_config_stage.yml
218+ firebase hosting:channel:deploy ${STAGE_NAME} \
219+ --project ${FIREBASE_ALIAS} \
220+ --token ${FIREBASE_TOKEN}
215221
216222
217223
0 commit comments