46 lines
1.3 KiB
Makefile
46 lines
1.3 KiB
Makefile
|
|
.PHONY: generate
|
|
generate:
|
|
./genproto.sh
|
|
go generate ./...
|
|
|
|
.PHONY: test
|
|
test:
|
|
go test -json ./... | docker run -i ghcr.io/gotesttools/gotestfmt:latest
|
|
|
|
.PHONY: migrate-dev
|
|
migrate-dev:
|
|
./migrate_dev.sh
|
|
|
|
.PHONY: migrate-prod
|
|
migrate-prod:
|
|
./migrate_prod.sh
|
|
|
|
# ex: make create-migration ARG="create_users_table"
|
|
create-migration:
|
|
echo "Creating migration with name $(ARG)"
|
|
docker run -v ./migrations:/migrations --network host migrate/migrate create -ext sql -seq -dir /migrations $(ARG)
|
|
|
|
dev-database:
|
|
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:
|
|
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"
|
|
|
|
.PHONY: deploy-dev
|
|
deploy-dev: generate test
|
|
./deploy_dev.sh
|
|
|
|
.PHONY: deploy-prod
|
|
deploy-prod: generate test
|
|
./deploy_prod.sh
|
|
|