quality-of-life tweaks for developers (#57)

This commit is contained in:
Chuck Adams 2025-06-05 10:49:48 -06:00 committed by GitHub
parent ca4af11282
commit 64e58dd674
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 30 additions and 2 deletions

View file

@ -1,10 +1,21 @@

COMPOSER = composer
#COMPOSER = docker compose run -it --rm aspiresync composer
EXEC := meta/bin/dcexec
# EXEC :=

COMPOSER := $(EXEC) composer

build:
$(COMPOSER) install

init: init-docker build migrate

init-docker:
docker compose down --remove-orphans --volumes
docker compose up -d

migrate:
$(EXEC) bin/console doctrine:migrations:migrate --no-interaction

test:
$(COMPOSER) run test


View file

@ -34,6 +34,11 @@ services:
aspire-net:
aliases:
- 'db.sync.aspiredev.org'
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 5s
timeout: 5s
retries: 10

networks:
app-net: ~

10
meta/bin/dcexec Executable file
View file

@ -0,0 +1,10 @@
#!/bin/bash

. $(dirname $0)/prelude.bash

if which docker >/dev/null 2>&1; then
exec docker compose exec $APP_SERVICE "$@"
else
# no docker means we're probably already in docker
exec "$@"
fi

View file

@ -1,6 +1,8 @@
# This file should be sourced, not run
[[ -n $TRACE ]] && [[ $TRACE != 0 ]] && set -x

APP_SERVICE=${APP_SERVICE:-webapp}

set -o errexit

cd $(dirname $0)/../..