@@ -27,19 +27,23 @@ prepare: ## Install dependencies and pre-commit hook
2727 gcloud init
2828 gcloud auth configure-docker europe-north1-docker.pkg.dev
2929
30+ # Doc and tests
31+
3032doc : # # Build Sphinx documentation
3133 sphinx-build -b html docs docs/html
3234
3335test : # # Run tests with coverage
3436 pytest --cov simdec --cov-report term-missing
3537
38+ # Dashboard commands
39+
3640serve-dev : # # Serve Panel dashboard - Dev mode
3741 panel serve panel/app.py \
3842 --show --autoreload \
3943 --static-dirs _static=docs/_static \
4044 --reuse-sessions --warm
4145
42- serve : # # Serve Panel dashboard - Prod mode with basic auth
46+ serve : # # Serve Panel dashboard - Prod mode with basic auth. Needs: PANEL_TOKEN
4347 panel serve panel/app.py \
4448 --show \
4549 --cookie-secret panel_cookie_secret_oauth \
@@ -48,7 +52,7 @@ serve: ## Serve Panel dashboard - Prod mode with basic auth
4852 --static-dirs _static=docs/_static \
4953 --reuse-sessions --warm
5054
51- serve-oauth : # # Serve Panel dashboard - Prod mode with OAuth2
55+ serve-oauth : # # Serve Panel dashboard - Prod mode with OAuth2. Needs: PANEL_OAUTH_REDIRECT_URI, PANEL_OAUTH_KEY, PANEL_OAUTH_SECRET
5256 panel serve panel/app.py \
5357 --show \
5458 --cookie-secret panel_cookie_secret_oauth \
@@ -57,22 +61,25 @@ serve-oauth: ## Serve Panel dashboard - Prod mode with OAuth2
5761 --static-dirs _static=docs/_static \
5862 --reuse-sessions --warm
5963
64+ # Deployment commands
65+
6066build-local :
6167 docker build -f ./Dockerfile \
6268 --build-arg PANEL_TOKEN=$(PANEL_TOKEN ) \
63- --tag simdec-panel:$(version ) \
69+ --tag simdec-panel-local :$(version ) \
6470 --pull \
6571 ./.
6672
6773run-local : build-local
6874 docker run --rm -it \
69- --name =simdec-panel \
75+ --name =simdec-panel-local \
7076 --memory=1g \
7177 --cpuset-cpus=0 \
7278 -e ENV=development \
7379 -p "8080:8080" \
74- simdec-panel:$(version )
80+ simdec-panel-local :$(version )
7581
82+ # Need to specifically build on linux/amd64 to avoid issues on macOS M platform
7683build :
7784 docker build -f ./Dockerfile \
7885 --platform linux/amd64 \
@@ -90,6 +97,8 @@ run: build
9097 -p "8080:8080" \
9198 simdec-panel:$(version )
9299
100+ # Ship
101+
93102publish-production : build
94103 docker tag simdec-panel:$(version ) $(region ) -docker.pkg.dev/$(project ) /simdec-panel/simdec-panel:$(version )
95104 docker push $(region ) -docker.pkg.dev/$(project ) /simdec-panel/simdec-panel:$(version )
0 commit comments