Files
llink/go/Taskfile.yml
T
Arjun PatelandGitHub c1f5b6c8c1 Implement membership notifications and deep-link handling for Electron desktop app (#246)
* security: add cors for desktop app scheme

* Revert "security: add cors for desktop app scheme"

This reverts commit d450fced75.

* ignore tags

* add commands for windows dev

* cleanup unnecessary parts of main desktop process

* resolve lint errors

* add format command for go

* fix: send email on new member joining

Closes #228

* add proper deeplinking on desktop

The desktop app was merely focusing before, but now it will navigate to the proper route

* honor email notifications setting

* prevent sending email when no recipients
2026-06-09 08:04:18 -07:00

100 lines
3.6 KiB
YAML

version: '3'
vars:
DEV_REPO: us-west2-docker.pkg.dev/flowy-dev-440017/deployments
PROD_REPO: us-west2-docker.pkg.dev/flowy-prod-440017/deployments
tasks:
generate:
desc: Generate protobuf code and run go generate
cmds:
- task: genproto
- go generate ./...
format:
desc: Format go files
cmds:
- go fmt ./...
genproto:
desc: Generate Go code from .proto files via docker
vars:
PROTO_DIR: '{{.PROTO_DIR | default "./protocol"}}'
OUT_DIR: '{{.OUT_DIR | default "./genproto"}}'
cmds:
- 'echo "Proto directory: {{.PROTO_DIR}}"'
- 'echo "Output directory: {{.OUT_DIR}}"'
- rm -rf {{.OUT_DIR}}
- mkdir -p {{.OUT_DIR}}
- |
docker run --rm \
-v "{{.PROTO_DIR}}/":/protocol \
-v "{{.OUT_DIR}}":/genproto \
--workdir / \
talksik/golang-protoc:latest \
sh -c 'protoc --proto_path=./protocol \
--go_out=./genproto \
--go_opt=paths=source_relative \
--go-grpc_out=./genproto \
--go-grpc_opt=paths=source_relative \
$(find ./protocol -name "*.proto")'
test:
desc: Run tests with pretty output via gotestfmt
cmds:
- go test -json ./... | docker run -i ghcr.io/gotesttools/gotestfmt:latest
create-migration:
desc: 'Create new migration (usage: task create-migration ARG=create_users_table)'
cmds:
- 'echo "Creating migration with name {{.ARG}}"'
- docker run -v ./migrations:/migrations --network host migrate/migrate create -ext sql -seq -dir /migrations {{.ARG}}
dev-database:
desc: Open psql shell against the dev database
interactive: true
cmds:
- |
kubectl run postgres-client \
--rm -it --image=postgres:latest \
--env="LLINK_POSTGRES_CONNECTION_URL=$(kubectl get secret shared-secrets -o jsonpath='{.data.LLINK_POSTGRES_CONNECTION_URL}' --context dev | base64 --decode)" \
--context dev \
--command -- /bin/bash -c "psql \$LLINK_POSTGRES_CONNECTION_URL"
prod-database:
desc: Open psql shell against the prod database
interactive: true
cmds:
- |
kubectl run postgres-client \
--rm -it --image=postgres:latest \
--env="LLINK_POSTGRES_CONNECTION_URL=$(kubectl get secret shared-secrets -o jsonpath='{.data.LLINK_POSTGRES_CONNECTION_URL}' --context prod | base64 --decode)" \
--context prod \
--command -- /bin/bash -c "psql \$LLINK_POSTGRES_CONNECTION_URL"
migrate-dev:
desc: Run migrations against dev cluster
cmds:
- kubectl delete job migrations --ignore-not-found --context=dev
- SKAFFOLD_DEFAULT_REPO={{.DEV_REPO}} skaffold run -p migrations --kube-context dev --tail
migrate-prod:
desc: Run migrations against prod cluster
cmds:
- kubectl delete job migrations --ignore-not-found --context=prod
- SKAFFOLD_DEFAULT_REPO={{.PROD_REPO}} skaffold run -p migrations --kube-context prod --tail
deploy-dev:
desc: 'Deploy to dev (optionally MODULE=orion to deploy a single service)'
cmds:
- task: generate
- task: test
- SKAFFOLD_DEFAULT_REPO={{.DEV_REPO}} skaffold run -p dev {{if .MODULE}}-m {{.MODULE}}{{end}} --kube-context dev --port-forward --tail
deploy-prod:
desc: 'Deploy to prod (optionally MODULE=orion to deploy a single service)'
cmds:
- task: generate
- task: test
- SKAFFOLD_DEFAULT_REPO={{.PROD_REPO}} skaffold run -p prod {{if .MODULE}}-m {{.MODULE}}{{end}} --kube-context prod --port-forward --tail