-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontroller.sh
More file actions
44 lines (41 loc) · 1.19 KB
/
controller.sh
File metadata and controls
44 lines (41 loc) · 1.19 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
#!/bin/bash
echo "controller.sh | all-in-one vde controller"
commands="Available commands: fetch, down, up, pull, build, help, exit"
while true; do
echo -n "> "
read cmd
case $cmd in
fetch)
echo "Fetching latest changes from git..."
git fetch
;;
up)
echo "Starting Docker containers with docker compose up..."
docker compose up
;;
build)
echo "Starting Docker containers with docker compose up --build..."
docker compose up --build
;;
pull)
echo "Pulling latest changes from git..."
git pull
echo "Attempting to pull Docker images (if any are registry-based)..."
docker compose pull || echo "Some images couldn't be pulled (normal for local builds)"
;;
down)
echo "Stopping Docker containers with docker compose down..."
docker compose down
;;
help)
echo "$commands"
;;
exit)
read cmd
break
;;
*)
echo "Invalid command. $commands"
;;
esac
done