Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fly.io scripts for app status and connecting to database #90

Merged
merged 1 commit into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ SENTRY_DSN="your-dsn"
GITHUB_CLIENT_ID="MOCK_GITHUB_CLIENT_ID"
GITHUB_CLIENT_SECRET="MOCK_GITHUB_CLIENT_SECRET"
GITHUB_TOKEN="MOCK_GITHUB_TOKEN"

FLY_APP_NAME="fly-app-name-1234"
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
"typecheck:watch": "tsc -w",
"validate": "run-p \"test -- --run\" lint typecheck test:e2e:run",
"data:migrate": "npx vite-node ./prisma/data-migrations/create-artboard-versions-and-branches.ts",
"fly:status": "./scripts/fly.io/app-status.sh",
"fly:console:prisma:studio": "./scripts/fly.io/app-console-prisma-studio.sh",
"fly:console:prisma:studio:proxy": "./scripts/fly.io/app-console-prisma-studio-proxy.sh",
"prepare": "husky install"
},
"eslintIgnore": [
Expand Down
14 changes: 14 additions & 0 deletions scripts/fly.io/app-console-prisma-studio-proxy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

# https://github.com/epicweb-dev/epic-stack/blob/main/docs/database.md
# to give permission to execute the file locally run:
# chmod +x scripts/fly.io/app-console-prisma-studio-proxy.sh

# run prisma studio on fly app
# npm run fly:app:console:prisma:studio
# run proxy to prisma studio on fly app to local port (separate terminal)
# npm run fly:app:console:prisma:studio:proxy

source .env

fly proxy 5556:5555 --app $FLY_APP_NAME
14 changes: 14 additions & 0 deletions scripts/fly.io/app-console-prisma-studio.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

# https://github.com/epicweb-dev/epic-stack/blob/main/docs/database.md
# to give permission to execute the file locally run:
# chmod +x scripts/fly.io/app-console-prisma-studio.sh

# run prisma studio on fly app
# npm run fly:app:console:prisma:studio
# run proxy to prisma studio on fly app to local port (separate terminal)
# npm run fly:app:console:prisma:studio:proxy

source .env

fly ssh console -C "npm run prisma:studio" --app $FLY_APP_NAME
9 changes: 9 additions & 0 deletions scripts/fly.io/app-status.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

# https://github.com/epicweb-dev/epic-stack/blob/main/docs/database.md
# to give permission to execute the file locally run:
# chmod +x scripts/fly.io/app-status.sh

source .env

fly status --app $FLY_APP_NAME
Loading