mirror of
https://github.com/mentos1386/zdravko.git
synced 2024-11-25 08:58:50 +00:00
feat(cmd): flags false by default
This commit is contained in:
parent
478232bcda
commit
1221f524d5
4 changed files with 16 additions and 12 deletions
|
@ -8,7 +8,7 @@ Mostly just a project to test [temporal.io](https://temporal.io/).
|
|||
- [x] SSO Support for authentication.
|
||||
- [x] SQLite for database.
|
||||
- This means for main app db as well as temporal db.
|
||||
- [ ] Single binary.
|
||||
- [x] Single binary.
|
||||
- One binary to run worker, server and temporal all together.
|
||||
- [ ] Abbility for multiple workers.
|
||||
- Spread workers across regions to monitor latency from different locations.
|
||||
|
|
|
@ -25,9 +25,9 @@ func main() {
|
|||
var startWorker bool
|
||||
var startTemporal bool
|
||||
|
||||
flag.BoolVar(&startServer, "server", true, "Start the server")
|
||||
flag.BoolVar(&startWorker, "worker", true, "Start the worker")
|
||||
flag.BoolVar(&startTemporal, "temporal", true, "Start the temporal")
|
||||
flag.BoolVar(&startServer, "server", false, "Start the server")
|
||||
flag.BoolVar(&startWorker, "worker", false, "Start the worker")
|
||||
flag.BoolVar(&startTemporal, "temporal", false, "Start the temporal")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
|
@ -36,6 +36,10 @@ func main() {
|
|||
println("Worker: ", startWorker)
|
||||
println("Temporal: ", startTemporal)
|
||||
|
||||
if !startServer && !startWorker && !startTemporal {
|
||||
log.Fatal("At least one of the following must be set: --server, --worker, --temporal")
|
||||
}
|
||||
|
||||
cfg := config.NewConfig()
|
||||
|
||||
var servers [3]StartableAndStoppable
|
||||
|
|
|
@ -17,8 +17,8 @@ primary_region = 'waw'
|
|||
TEMPORAL_SERVER_HOST = 'server.process.zdravko.internal:7233'
|
||||
|
||||
[processes]
|
||||
server = '--temporal=true --server=true --worker=false'
|
||||
worker = '--temporal=false --server=false --worker=true'
|
||||
server = '--temporal --server'
|
||||
worker = '--worker'
|
||||
|
||||
[[mounts]]
|
||||
source = 'data'
|
||||
|
|
12
justfile
12
justfile
|
@ -33,18 +33,18 @@ run:
|
|||
|
||||
run-worker:
|
||||
go build -o dist/zdravko cmd/zdravko/main.go
|
||||
./dist/zdravko --worker=true --server=false --temporal=false
|
||||
./dist/zdravko --worker
|
||||
|
||||
# Start zdravko
|
||||
run-zdravko:
|
||||
go build -o dist/zdravko cmd/zdravko/main.go
|
||||
./dist/zdravko --server --temporal
|
||||
|
||||
# Generates new jwt key pair
|
||||
generate-jwt-key:
|
||||
openssl genrsa -out jwt.private.pem 2048
|
||||
openssl rsa -pubout -in jwt.private.pem -out jwt.public.pem
|
||||
|
||||
# Start zdravko
|
||||
run-zdravko:
|
||||
go build -o dist/zdravko cmd/zdravko/main.go
|
||||
./dist/zdravko --worker=false
|
||||
|
||||
# Deploy the application to fly.io
|
||||
deploy:
|
||||
fly deploy --ha=false -c deploy/fly.toml -i {{DOCKER_IMAGE}}
|
||||
|
|
Loading…
Reference in a new issue