-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
48 lines (39 loc) · 1.16 KB
/
Copy pathjustfile
File metadata and controls
48 lines (39 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
set dotenv-load
set shell := ["sh", "-e", "-o", "pipefail", "-c"]
compose_file := ".nvil.yaml"
service := "nvil"
# Quick aliases
alias c := connect
alias s := stop
alias d := delete
alias hr := hard-reset
# List all available commands
[default]
list:
@just --list
# Copy .env.sample to .env if missing (run once)
init-env:
@if [ ! -f .env ]; then \
echo "Making copy of .env.sample to .env. You may edit it according to your needs."; \
cp .env.sample .env; \
fi
# Start and connect to nvil container via zellij
connect: init-env start-runtime
podman compose -f {{compose_file}} up -d
podman compose -f {{compose_file}} exec {{service}} zsh -ic zellij
start-runtime:
@if podman machine list | grep -q "Currently running"; then \
echo "Podman machine already started"; \
else \
echo "Starting Podman machine..."; \
podman machine start; \
fi
# Stop container (preserves volumes/state)
stop: start-runtime
podman compose -f {{compose_file}} stop {{service}}
# Reset
hard-reset: delete connect
# Delete container stack AND volumes
[confirm("Delete nvil container stack and volumes? (y/n)")]
delete: start-runtime
podman compose -f {{compose_file}} down -v