Skip to content

Commit

Permalink
refactor: rename .env.selfhost to .env.hpi
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesvedder committed Aug 1, 2023
1 parent 3b8bf71 commit dae7d46
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 28 deletions.
6 changes: 2 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,8 @@ convenience:

- `.env`: Production database used by default
- `.env.staging`: Staging database, currently not ready to be used
- `.env.local`: Used to run StudyU locally with Docker with the deployed
production instance of Supabase
- `.env.selfhost`: Used for a selfhosted instance of Supabase, e.g. an instance
running locally with Docker
- `.env.local`: Used to run StudyU locally with Docker
- `.env.hpi`: Used for a selfhost instance of Supabase at HPI

Ideally we should only use the staging database or a local one for all our
development work.
Expand Down
2 changes: 1 addition & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ run StudyU after you made changes to the codebase. Switch to the `.env.local`
[environment file](https://github.com/hpi-studyu/studyu/blob/dev/flutter_common/lib/envs/.env.local)
to use the StudyU database with local StudyU applications. For this modify the
`docker-compose-*.yml` files you want to run (see below), and replace
`../flutter_common/lib/envs/.env.selfhost` with
`../flutter_common/lib/envs/.env.hpi` with
`../flutter_common/lib/envs/.env.local` in the section `env_file`.

To start both the StudyU App and the StudyU Designer, simply run `docker compose
Expand Down
2 changes: 1 addition & 1 deletion flutter_common/.pubignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
!.env
!.env.local
!.env.selfhost
!.env.hpi
!.env.staging
5 changes: 5 additions & 0 deletions flutter_common/lib/envs/.env.hpi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
STUDYU_SUPABASE_URL=https://studyu-01.dhc-lab.hpi.de
STUDYU_SUPABASE_PUBLIC_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICAgInJvbGUiOiAiYW5vbiIsCiAgICAiaXNzIjogInN1cGFiYXNlIiwKICAgICJpYXQiOiAxNjg0OTY1NjAwLAogICAgImV4cCI6IDE4NDI4MTg0MDAKfQ.DGwmdkvtegFdBVkSRTNhI1BsnfDyEx9vK-bdW7i9yfU
STUDYU_PROJECT_GENERATOR_URL=
STUDYU_APP_URL=http://localhost:8080
STUDYU_DESIGNER_URL=http://localhost:8081
5 changes: 0 additions & 5 deletions flutter_common/lib/envs/.env.selfhost

This file was deleted.

2 changes: 1 addition & 1 deletion flutter_common/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ flutter:
assets:
- packages/studyu_flutter_common/envs/.env
- packages/studyu_flutter_common/envs/.env.local
- packages/studyu_flutter_common/envs/.env.selfhost
- packages/studyu_flutter_common/envs/.env.hpi
- packages/studyu_flutter_common/envs/.env.staging
38 changes: 22 additions & 16 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,18 @@ scripts:
dev:designer:
run: |
melos exec -c 1 -- \
"flutter run -d chrome --web-port 3001 --dart-define=STUDYU_ENV=.env.selfhost"
"flutter run -d chrome --web-port 3001 --dart-define=STUDYU_ENV=.env.hpi"
packageFilters:
scope: studyu_designer_v2
description: Runs designer in Chrome on port 3001 with selfhost env for local development
description: Runs designer in Chrome on port 3001 with hpi env for local development

dev:app:
run: |
melos exec -c 1 -- \
"flutter run --dart-define=STUDYU_ENV=.env.selfhost"
"flutter run --dart-define=STUDYU_ENV=.env.hpi"
packageFilters:
scope: studyu_app
description: Runs app with selfhost env for local development
description: Runs app with hpi env for local development

build:android:
run: |
Expand Down Expand Up @@ -186,28 +186,26 @@ scripts:
scope: studyu_designer_v2
dir-exists: web

# Selfhost Env

build:web:app:selfhost:
build:web:app:hpi:
run: |
melos exec -c 1 --fail-fast -- \
"flutter build web --web-renderer auto --no-tree-shake-icons --dart-define=STUDYU_ENV=.env.selfhost"
"flutter build web --web-renderer auto --no-tree-shake-icons --dart-define=STUDYU_ENV=.env.hpi"
description: Build app for Docker and self-hosted Supabase instance.
packageFilters:
scope: studyu_app

build:web:designer:selfhost:
build:web:designer:hpi:
run: |
melos exec -c 1 --fail-fast -- \
"flutter build web --web-renderer auto --no-tree-shake-icons --dart-define=STUDYU_ENV=.env.selfhost"
"flutter build web --web-renderer auto --no-tree-shake-icons --dart-define=STUDYU_ENV=.env.hpi"
description: Build designer for Docker and self-hosted Supabase instance.
packageFilters:
scope: studyu_designer

build:web:designer_v2:selfhost:
build:web:designer_v2:hpi:
run: |
melos exec -c 1 --fail-fast -- \
"flutter build web --web-renderer auto --no-tree-shake-icons --dart-define=STUDYU_ENV=.env.selfhost"
"flutter build web --web-renderer auto --no-tree-shake-icons --dart-define=STUDYU_ENV=.env.hpi"
description: Build designer_v2 for Docker and self-hosted Supabase instance.
packageFilters:
scope: studyu_designer_v2
Expand All @@ -216,15 +214,23 @@ scripts:
app:web:local:
run: |
melos exec -c 1 -- \
"flutter run lib/main.dart -d chrome --web-port 3001 --dart-define=STUDYU_ENV=.env.local"
"flutter run lib/main.dart -d chrome --web-port 8080 --dart-define=STUDYU_ENV=.env.local"
packageFilters:
scope: studyu_app
description: Runs app in chrome on port 3001 with local env
description: Runs app in chrome on port 8080 with local env

designer:web:local:
run: |
melos exec -c 1 -- \
"flutter run lib/main.dart -d chrome --web-port 3000 --dart-define=STUDYU_ENV=.env.local"
"flutter run lib/main.dart -d chrome --web-port 8083 --dart-define=STUDYU_ENV=.env.local"
packageFilters:
scope: studyu_designer
description: Runs designer in chrome on port 3000 with local env
description: Runs designer in chrome on port 8083 with local env

designer_v2:web:local:
run: |
melos exec -c 1 -- \
"flutter run lib/main.dart -d chrome --web-port 8081 --dart-define=STUDYU_ENV=.env.local"
packageFilters:
scope: studyu_designer_v2
description: Runs designer in chrome on port 8081 with local env

0 comments on commit dae7d46

Please sign in to comment.