This repository has no description
lustre gleam
0

Configure Feed

Select the types of activity you want to include in your feed.

sigo / justfile
2.8 kB 107 lines
1mod client 2mod server 3mod shared 4 5set quiet := true 6 7pod_name := "pod_sigo" 8 9# database 10 11pg_image := "docker.io/postgres:18-alpine" 12pg_env := "-e POSTGRES_USER -e POSTGRES_PASSWORD -e POSTGRES_DB" 13pg_volume := "-v ./sql/create:/docker-entrypoint-initdb.d" 14pg_health_cmd := "--health-cmd 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}'" 15pg_health_conf := "--health-interval 10s --health-retries 3 --health-timeout 5s" 16pg_health_start_period := "--health-start-period 30s" 17 18# server 19 20run_server_locally := env("RUN_SERVER_LOCALLY", "false") 21server_port := if run_server_locally == "false" { "-p 8000:8000" } else { "" } 22server_health_cmd := "--health-cmd 'wget -q --spider http://127.0.0.1:8000/api/health || exit 1'" 23server_health_conf := "--health-interval 30s --health-retries 3 --health-timeout 10s" 24server_health_start_period := "--health-start-period 10s" 25 26# List available recipes 27_default: 28 just --list 29 30# 󰌢 Build Lustre runtime and start HTTP server 31[group("dev")] 32dev: 33 just client::build 34 just server::run 35 36#  Update project dependencies 37[group("dev")] 38deps-update: 39 just shared::deps-update 40 just client::deps-update 41 just server::deps-update 42 43#  Check for errors 44[group("dev")] 45lint: 46 just server::lint 47 just client::lint 48 just shared::lint 49 50# 󰙨 Run unit tests 51[group("dev")] 52test: 53 just server::test 54 55# 󰏖 Create pod 56[group("podman")] 57_create-pod: 58 podman pod exists {{ pod_name }} || \ 59 podman pod create \ 60 --name {{ pod_name }} \ 61 {{ server_port }} \ 62 -p 5432:5432 63 64# 󰏖 Build the server container image 65[group("podman")] 66build-server: 67 podman build -t sigo-server . 68 69#  Starts the PostgreSQL database inside the pod 70[group("podman")] 71_init-database: _create-pod 72 podman run -d \ 73 --pod {{ pod_name }} \ 74 --name db \ 75 {{ pg_env }} \ 76 {{ pg_health_cmd }} {{ pg_health_conf }} {{ pg_health_start_period }} \ 77 {{ pg_volume }} \ 78 {{ pg_image }} 79 80#  Starts the server 81[group("podman")] 82_init-server: _create-pod build-server 83 podman run -d \ 84 --pod {{ pod_name }} \ 85 --name server \ 86 -e DATABASE_URL -e SECRET_KEY \ 87 {{ server_health_cmd }} \ 88 {{ server_health_conf }} \ 89 {{ server_health_start_period }} \ 90 sigo-server 91 92#  Starts the server and database 93[group("podman")] 94up: _init-database _init-server 95 echo {{ GREEN }}"Listening on http://0.0.0.0:8000"{{ NORMAL }} 96 97#  Starts only the database 98[group("podman")] 99db-up: _init-database 100 echo {{ GREEN }}" PostgreSQL is ready on port 5432"{{ NORMAL }} 101 102#  Stop and remove the entire pod 103[group("podman")] 104down: 105 podman pod exists {{ pod_name }} || (echo "Pod does not exist" && exit 1) 106 podman pod stop {{ pod_name }} 107 podman pod rm {{ pod_name }}