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 {
srv := s
if srv == nil {
continue
}
println("Starting", srv.Name())
wg.Add(1)
go func() {
@ -85,13 +89,15 @@ func main() {
go func() {
for sig := range c {
log.Printf("Received signal: %v", sig)
for _, s := range servers {
if s != nil {
println("Stopping", s.Name())
err := s.Stop()
if err != nil {
log.Fatalf("Unable to stop server %s: %v", s.Name(), err)
}
for _, srv := range servers {
if srv == nil {
continue
}
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
min_machines_running = 0
processes = ['server']
[[services.ports]]
port = 7233
handlers = ['tls']
[[services.ports]]
port = 7233
handlers = ['tls']
[[vm]]
cpu_kind = 'shared'

View file

@ -3,11 +3,13 @@ set shell := ["devbox", "run"]
# Load dotenv
set dotenv-load
GIT_SHA := `git rev-parse --short HEAD`
DOCKER_IMAGE := "ghcr.io/mentos1386/zdravko:sha-"+GIT_SHA
STATIC_DIR := "./web/static"
# Build the application
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:
@ -20,7 +22,7 @@ run-zdravko:
# Deploy the application to fly.io
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
shell: