https://github.com/porter-dev/switchboard
Control plane for cloud-based resources.
https://github.com/porter-dev/switchboard
Last synced: about 1 year ago
JSON representation
Control plane for cloud-based resources.
- Host: GitHub
- URL: https://github.com/porter-dev/switchboard
- Owner: porter-dev
- Created: 2021-11-16T20:04:07.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-07-28T14:24:21.000Z (over 2 years ago)
- Last Synced: 2025-02-16T16:56:52.055Z (about 1 year ago)
- Language: Go
- Size: 27.4 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Quick Start
Start by building the Switchboard binary:
```
make build-cli-dev
```
Then run an example TF and Helm deployment:
```
./bin/switchboard apply ./examples/terraform/test-resource-1.yaml
```
This will deploy a TF resource with a dependent deployment, and should print something like this to the console:
```
INF running apply for resource rds
INF successfully applied resource rds
INF running apply for resource tf-deployment
INF successfully applied resource tf-deployment
```
## Hooks
Hooks can be added to the worker when calling the package:
```go
type TestHook struct{}
func (t *TestHook) PreApply() error {
fmt.Println("RUNNING PRE APPLY")
return nil
}
func (t *TestHook) DataQueries() map[string]interface{} {
return map[string]interface{}{
"first": "{ .test-deployment.spec.replicas }",
}
}
func (t *TestHook) PostApply(populatedData map[string]interface{}) error {
fmt.Println("POPULATED DATA IS", populatedData)
return nil
}
```
Registered via:
```go
worker.RegisterHook("test", &TestHook{})
```