mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-14 10:09:33 -06:00
Add Gitpod support to the Formbricks Repo (#718)
* Initialized Gitpod tested scripts * ignored ports 1025 and 8025 * added website dev environment * removed api and error tasks and prioritized web task to be shown first
This commit is contained in:
6
.gitpod.Dockerfile
vendored
Normal file
6
.gitpod.Dockerfile
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
FROM gitpod/workspace-full
|
||||
|
||||
# Install custom tools, runtime, etc.
|
||||
RUN brew install yq
|
||||
|
||||
RUN pnpm install turbo --global
|
||||
76
.gitpod.yml
Normal file
76
.gitpod.yml
Normal file
@@ -0,0 +1,76 @@
|
||||
tasks:
|
||||
- name: demo
|
||||
init: |
|
||||
gp sync-await init-install &&
|
||||
bash .gitpod/setup-demo.bash
|
||||
command: |
|
||||
cd apps/demo &&
|
||||
cp .env.example .env &&
|
||||
sed -i -r "s#^(NEXT_PUBLIC_FORMBRICKS_API_HOST=).*#\1 $(gp url 3000)#" .env &&
|
||||
gp sync-await init &&
|
||||
turbo --filter "@formbricks/demo" go
|
||||
|
||||
- name : website
|
||||
command: gp sync-await init && turbo --filter "@formbricks/formbricks-com" dev
|
||||
|
||||
- name: Init Formbricks
|
||||
init: |
|
||||
cp .env.example .env &&
|
||||
bash .gitpod/init.bash &&
|
||||
turbo --filter "@formbricks/js" build &&
|
||||
gp sync-done init-install
|
||||
command: |
|
||||
gp sync-done init &&
|
||||
gp tasks list &&
|
||||
gp ports await 3002 && gp ports await 3000 && gp open apps/demo/.env && gp preview $(gp url 3002) --external
|
||||
|
||||
- name: web
|
||||
init: |
|
||||
gp sync-await init-install &&
|
||||
bash .gitpod/setup-web.bash &&
|
||||
turbo --filter "@formbricks/database" db:down
|
||||
command: |
|
||||
gp sync-await init &&
|
||||
cp .env.example .env &&
|
||||
sed -i -r "s#^(NEXT_PUBLIC_WEBAPP_URL=).*#\1 $(gp url 3000)#" .env &&
|
||||
sed -i -r "s#^(NEXTAUTH_URL=).*#\1 $(gp url 3000)#" .env &&
|
||||
turbo --filter "@formbricks/web" go
|
||||
|
||||
image:
|
||||
file: .gitpod.Dockerfile
|
||||
|
||||
ports:
|
||||
- port: 3000
|
||||
visibility: public
|
||||
onOpen: open-browser
|
||||
- port: 3001
|
||||
visibility: public
|
||||
onOpen: ignore
|
||||
- port: 3002
|
||||
visibility: public
|
||||
onOpen: ignore
|
||||
- port: 5432
|
||||
visibility: public
|
||||
onOpen: ignore
|
||||
- port: 1025
|
||||
visibility: public
|
||||
onOpen: ignore
|
||||
- port: 8025
|
||||
visibility: public
|
||||
onOpen: ignore
|
||||
|
||||
github:
|
||||
prebuilds:
|
||||
master: true
|
||||
pullRequests: true
|
||||
addComment: true
|
||||
|
||||
vscode:
|
||||
extensions:
|
||||
- "ban.spellright"
|
||||
- "bradlc.vscode-tailwindcss"
|
||||
- "DavidAnson.vscode-markdownlint"
|
||||
- "dbaeumer.vscode-eslint"
|
||||
- "esbenp.prettier-vscode"
|
||||
- "Prisma.prisma"
|
||||
- "yzhang.markdown-all-in-one"
|
||||
18
.gitpod/init.bash
Normal file
18
.gitpod/init.bash
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
images=($(yq eval '.services.*.image' packages/database/docker-compose.yml))
|
||||
|
||||
pull_image() {
|
||||
docker pull "$1"
|
||||
}
|
||||
|
||||
# install packages in background
|
||||
pnpm i &
|
||||
|
||||
# pull images
|
||||
for image in "${images[@]}"
|
||||
do
|
||||
pull_image "$image" &
|
||||
done
|
||||
|
||||
wait
|
||||
5
.gitpod/setup-demo.bash
Normal file
5
.gitpod/setup-demo.bash
Normal file
@@ -0,0 +1,5 @@
|
||||
for task in $(yq -r -oy '.pipeline."@formbricks/demo#go".dependsOn[]' turbo.json); do
|
||||
package="${task%#*}"
|
||||
command="${task#*#}"
|
||||
turbo --filter "$package" $command
|
||||
done
|
||||
5
.gitpod/setup-web.bash
Normal file
5
.gitpod/setup-web.bash
Normal file
@@ -0,0 +1,5 @@
|
||||
for task in $(yq -r -oy '.pipeline."@formbricks/web#go".dependsOn[]' turbo.json); do
|
||||
package="${task%#*}"
|
||||
command="${task#*#}"
|
||||
turbo --filter "$package" $command
|
||||
done
|
||||
@@ -5,7 +5,7 @@
|
||||
"scripts": {
|
||||
"clean": "rimraf .turbo node_modules .next",
|
||||
"dev": "next dev -p 3002 --turbo",
|
||||
"go": "next dev -p 3002 --turbo",
|
||||
"go": "next dev -p 3002",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint"
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"db:up": "docker-compose up -d",
|
||||
"db:setup": "pnpm db:up && pnpm db:migrate:dev",
|
||||
"db:start": "pnpm db:setup",
|
||||
"db:down": "docker-compose down",
|
||||
"format": "prisma format",
|
||||
"generate": "prisma generate",
|
||||
"lint": "eslint ./src --fix",
|
||||
|
||||
11
turbo.json
11
turbo.json
@@ -10,6 +10,13 @@
|
||||
"persistent": true,
|
||||
"dependsOn": ["@formbricks/database#db:setup", "@formbricks/js#build"]
|
||||
},
|
||||
"@formbricks/demo#go": {
|
||||
"cache": false,
|
||||
"persistent": true,
|
||||
"dependsOn": [
|
||||
"@formbricks/js#build"
|
||||
]
|
||||
},
|
||||
"@formbricks/api#build": {
|
||||
"outputs": ["dist/**"],
|
||||
"dependsOn": ["^build"]
|
||||
@@ -94,6 +101,10 @@
|
||||
"cache": false,
|
||||
"outputs": []
|
||||
},
|
||||
"db:down": {
|
||||
"cache": false,
|
||||
"outputs": []
|
||||
},
|
||||
"go": {
|
||||
"persistent": true,
|
||||
"cache": false
|
||||
|
||||
Reference in New Issue
Block a user