mirror of
https://github.com/hanzo-fi/payments.git
synced 2026-10-30 20:31:20 +00:00
- go.mod module path + all self-imports: github.com/formancehq/payments -> github.com/hanzo-fi/payments (1590 .go files / 3152 refs; 20 modules: root, pkg/client, pkg/domain, 18 ce/plugins). External dep kept: formancehq/go-libs. - plugins: each ce/plugins/* consumed a *published* pkg/domain; added local 'replace .../pkg/domain => ../../../pkg/domain' (consistent with root) so every standalone plugin module builds in-monorepo. compile-plugin.sh MOD var rebranded too. - branding: README, LICENSE (dual MIT+EE; upstream copyright retained + Hanzo added), goreleaser (release images -> registry.hanzo.ai/hanzo-fi, OCI labels, homepage), proto go_package, renovate, speakeasy gen.yaml, connector-template *.gotpl. - CI: removed Numary/Formance workflows + composite action; added canonical hanzo.yml + cicd.yml (hanzoai/ci, gated HANZO_CI_ENABLED) + secretless ci.yml (go build/vet). - kept as data/compat keys: wire capability enums ALLOW_FORMANCE_*, generated SDK type client.Formance, domain field FormanceRedirectURL, OTEL_SERVICE_NAME, upstream base image. - verified: go build ./... (default + -tags ee) + all 20 nested modules green.
111 lines
4.3 KiB
Makefile
111 lines
4.3 KiB
Makefile
set dotenv-load
|
|
|
|
default:
|
|
@just --list
|
|
|
|
pre-commit: tidy generate lint openapi compile-plugins compile-connector-capabilities
|
|
pc: pre-commit
|
|
|
|
lint:
|
|
@golangci-lint run --fix --build-tags it --timeout 5m
|
|
@set -e; for d in ce/plugins/*/; do cd "{{justfile_directory()}}/$d" && golangci-lint run --fix --build-tags it --timeout 5m && cd "{{justfile_directory()}}"; done
|
|
|
|
tidy:
|
|
@go run {{justfile_directory()}}/tools/sync-ce-plugins --connector-dir-path {{justfile_directory()}}/ce/plugins
|
|
@go mod tidy
|
|
@cd pkg/domain && go mod tidy
|
|
@set -e; for d in ce/plugins/*/; do cd "{{justfile_directory()}}/$d" && go mod tidy && cd "{{justfile_directory()}}"; done
|
|
|
|
compile-plugins:
|
|
./tools/compile-plugins/compile-plugin.sh
|
|
|
|
[group('openapi')]
|
|
validate-openapi:
|
|
@go run github.com/getkin/kin-openapi/cmd/[email protected] openapi.yaml
|
|
|
|
[group('openapi')]
|
|
compile-connector-configs:
|
|
@go build -o compile-configs {{justfile_directory()}}/tools/compile-configs
|
|
./compile-configs --path {{justfile_directory()}}/ce/plugins --path {{justfile_directory()}}/ee/plugins --output {{justfile_directory()}}/openapi/v3/v3-connectors-config.yaml
|
|
@rm ./compile-configs
|
|
|
|
compile-connector-capabilities:
|
|
@go build -tags ee -o compile-capabilities {{justfile_directory()}}/tools/compile-capabilities
|
|
./compile-capabilities --path {{justfile_directory()}}/ce/plugins --path {{justfile_directory()}}/ee/plugins --output {{justfile_directory()}}/docs/other/connector-capabilities.json
|
|
@rm ./compile-capabilities
|
|
|
|
[group('openapi')]
|
|
compile-api-yaml: compile-connector-configs
|
|
@npx openapi-merge-cli --config {{justfile_directory()}}/openapi/openapi-merge.json
|
|
@yq -oy {{justfile_directory()}}/openapi.json > openapi.yaml
|
|
@rm {{justfile_directory()}}/openapi.json
|
|
|
|
[group('openapi')]
|
|
compile-api-docs:
|
|
@npx openapi-merge-cli --config {{justfile_directory()}}/openapi/openapi-docs-merge.json
|
|
@npx -y widdershins {{justfile_directory()}}/openapi.json -o {{justfile_directory()}}/docs/api/README.md --search false --language_tabs 'http:HTTP' --summary --omitHeader
|
|
@rm {{justfile_directory()}}/openapi.json
|
|
|
|
[group('openapi')]
|
|
openapi: compile-api-yaml compile-api-docs validate-openapi
|
|
|
|
[group('test')]
|
|
tests:
|
|
@go test -race -covermode=atomic \
|
|
-coverprofile coverage.txt \
|
|
-tags it \
|
|
./...
|
|
@cd pkg/domain && go test -race ./...
|
|
@set -e; for d in ce/plugins/*/; do \
|
|
name=$(basename "$d"); \
|
|
cd "{{justfile_directory()}}/$d" && \
|
|
go test -race -covermode=atomic -coverprofile "{{justfile_directory()}}/coverage-plugin-$name.txt" -tags it ./... && \
|
|
cd "{{justfile_directory()}}"; \
|
|
done
|
|
@for f in coverage-plugin-*.txt; do tail -n +2 "$f" >> coverage.txt && rm "$f"; done
|
|
|
|
[group('test')]
|
|
generate-sdk: openapi
|
|
@export PATH=$PATH:$(go env GOPATH)/bin && cd pkg/client && speakeasy run --skip-versioning
|
|
|
|
[group('test')]
|
|
generate: generate-sdk
|
|
@go generate ./...
|
|
@cd pkg/domain && go generate ./...
|
|
@set -e; for d in ce/plugins/*/; do cd "{{justfile_directory()}}/$d" && go generate ./... && cd "{{justfile_directory()}}"; done
|
|
|
|
[group('build')]
|
|
build-ce: compile-plugins
|
|
go build -ldflags "-X github.com/hanzo-fi/payments/cmd.Edition=community" -o payments .
|
|
|
|
[group('build')]
|
|
build-ee: compile-plugins
|
|
go build -tags ee -ldflags "-X github.com/hanzo-fi/payments/cmd.Edition=enterprise" -o payments-ee .
|
|
|
|
[group('releases')]
|
|
release-local:
|
|
@goreleaser release --nightly --skip=publish --clean
|
|
|
|
[group('releases')]
|
|
release-ci:
|
|
@goreleaser release --nightly --clean --parallelism 2
|
|
|
|
[group('releases')]
|
|
release:
|
|
@goreleaser release --clean --parallelism 2
|
|
|
|
[group('deploy')]
|
|
deploy server auth-token application additional-args:
|
|
@argocd app set --auth-token {{auth-token}} --server {{server}} {{application}} --grpc-web {{additional-args}}
|
|
@argocd app sync --auth-token {{auth-token}} --server {{server}} {{application}} --grpc-web
|
|
|
|
[group('plugins')]
|
|
bootstrap-plugin CONNECTOR_NAME EDITION="public":
|
|
@go build -o connector-template {{justfile_directory()}}/tools/connector-template
|
|
@if [ "{{EDITION}}" = "enterprise" ]; then \
|
|
./connector-template --connector-dir-path {{justfile_directory()}}/ee/plugins --connector-name {{CONNECTOR_NAME}}; \
|
|
else \
|
|
./connector-template --connector-dir-path {{justfile_directory()}}/ce/plugins --connector-name {{CONNECTOR_NAME}}; \
|
|
fi
|
|
@rm ./connector-template
|