Up your service locally.
$ eval $(lift up)
Full description of the idea is available here.
In Avito we have an excellent PaaS which helps us to run our services in Kubernetes clusters with just a few commands. But I want to run it so quickly and frequently as possible to debug during development. For that reason, I need a possibility to up services written on Go locally from IDE like GoLand without losing the benefits that minikube provides.
🤼♂️ How to
Describe your dependencies and storage in
Define everything you need in
envs.local.env_vars. See an example.
Dump environment variables into
$ lift env > bin/.env
- Use it in your IDE with EnvFile plugin
shift + cmd + .to see hidden dot files
- Forward required ports using
kubectl port-forward, or use my other tool named forward for that
$ eval $(lift forward)
- or run all together
$ eval $(lift up -- go run cmd/service/main.go); eval $(lift down) $ eval $(lift forward -d) $ lift call -- go run cmd/service/main.go $ eval $(lift down)
Good to have
.PHONY: format format: @lift call -- goimports -local '$$GOMODULE' -ungroup -w . .PHONY: lift lift: @lift env > bin/.env .PHONY: up up: @avito start @avito service dev --no-watch @nohup $$(lift forward) & .PHONY: status status: @minikube status @kubectl get pod .PHONY: forward forward: @eval $$(lift forward) .PHONY: down down: @-avito service deletelocal @-eval $$(lift down)
$ brew install kamilsk/tap/lift
$ curl -sfL https://bit.ly/install-lift | bash
# use standard go tools $ go get -u github.com/kamilsk/lift # or use egg tool $ egg github.com/kamilsk/lift -- go install . $ egg bitbucket.org/kamilsk/lift -- go install .
Bash and Zsh completions
$ lift completion bash > /path/to/bash_completion.d/lift.sh $ lift completion zsh > /path/to/zsh-completions/_lift.zsh
1 The project is still in prototyping.↩