ci(deploy): trying to fix deploy

This commit is contained in:
Tine 2024-02-18 08:51:05 +01:00
parent bf8cdc2032
commit 4ae3570e74
Signed by: mentos1386
SSH key fingerprint: SHA256:MNtTsLbihYaWF8j1fkOHfkKNlnN1JQfxEU/rBU8nCGw
3 changed files with 20 additions and 13 deletions

View file

@ -69,6 +69,10 @@ func main() {
for _, s := range servers { for _, s := range servers {
srv := s srv := s
if srv == nil {
continue
}
println("Starting", srv.Name()) println("Starting", srv.Name())
wg.Add(1) wg.Add(1)
go func() { go func() {
@ -85,13 +89,15 @@ func main() {
go func() { go func() {
for sig := range c { for sig := range c {
log.Printf("Received signal: %v", sig) log.Printf("Received signal: %v", sig)
for _, s := range servers { for _, srv := range servers {
if s != nil { if srv == nil {
println("Stopping", s.Name()) continue
err := s.Stop() }
if err != nil {
log.Fatalf("Unable to stop server %s: %v", s.Name(), err) println("Stopping", srv.Name())
} err := srv.Stop()
if err != nil {
log.Fatalf("Unable to stop server %s: %v", srv.Name(), err)
} }
} }
} }

View file

@ -40,10 +40,9 @@ primary_region = 'waw'
auto_start_machines = true auto_start_machines = true
min_machines_running = 0 min_machines_running = 0
processes = ['server'] processes = ['server']
[[services.ports]]
[[services.ports]] port = 7233
port = 7233 handlers = ['tls']
handlers = ['tls']
[[vm]] [[vm]]
cpu_kind = 'shared' cpu_kind = 'shared'

View file

@ -3,11 +3,13 @@ set shell := ["devbox", "run"]
# Load dotenv # Load dotenv
set dotenv-load set dotenv-load
GIT_SHA := `git rev-parse --short HEAD`
DOCKER_IMAGE := "ghcr.io/mentos1386/zdravko:sha-"+GIT_SHA
STATIC_DIR := "./web/static" STATIC_DIR := "./web/static"
# Build the application # Build the application
build: build:
docker build -f build/Dockerfile -t ghcr.io/mentos1386/zdravko:latest . docker build -f build/Dockerfile -t {{DOCKER_IMAGE}} .
# Run full development environment # Run full development environment
run: run:
@ -20,7 +22,7 @@ run-zdravko:
# Deploy the application to fly.io # Deploy the application to fly.io
deploy: deploy:
fly deploy --ha=false -c deploy/fly.toml fly deploy --ha=false --smoke-checks=false -c deploy/fly.toml -i {{DOCKER_IMAGE}}
# Start devbox shell # Start devbox shell
shell: shell: