mirror of
https://github.com/ublue-os/forge.git
synced 2025-04-18 20:43:43 +03:00
feat: manage forge with one command (#14)
This commit is contained in:
parent
258a1ce7f7
commit
83379a0d72
10
README.md
10
README.md
|
@ -55,6 +55,12 @@ You can use the the user `ublue` and password `ublue` to login.
|
||||||
> At the moment there's only a dummy project included. Tasks for real life usage
|
> At the moment there's only a dummy project included. Tasks for real life usage
|
||||||
> will be included soon.
|
> will be included soon.
|
||||||
|
|
||||||
## Firing Up the Forge
|
## Handling the forge
|
||||||
|
|
||||||
To heat up the forge run `./setup.sh`.
|
You can use the `forge.sh` to **setup**, **heat-up** and **cool-down** the forge.
|
||||||
|
|
||||||
|
| Command | Description |
|
||||||
|
| ---------------------- | -------------------------------------------- |
|
||||||
|
| `./forge.sh setup` | Setup the forge for the first time or update |
|
||||||
|
| `./forge.sh heat-up` | Start the forge |
|
||||||
|
| `./forge.sh cool-down` | Stop the forge |
|
||||||
|
|
42
forge.sh
Executable file
42
forge.sh
Executable file
|
@ -0,0 +1,42 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Functions
|
||||||
|
function setup {
|
||||||
|
echo -e "${YELLOW}Heating up the forge for the first time..${ENDCOLOR}"
|
||||||
|
podman play kube forge-pod.yml --build --replace && podman logs --color -f ublue-os_forge-setup.ublue.local
|
||||||
|
echo -e "${GREEN}Done. Happy forging!${ENDCOLOR}"
|
||||||
|
}
|
||||||
|
|
||||||
|
function up {
|
||||||
|
echo -e "${YELLOW}Heating up the forge..${ENDCOLOR}"
|
||||||
|
podman pod start ublue-os_forge
|
||||||
|
echo -e "${GREEN}Done. Happy forging!${ENDCOLOR}"
|
||||||
|
}
|
||||||
|
|
||||||
|
function down {
|
||||||
|
echo -e "${YELLOW}Cooling down the forge..${ENDCOLOR}"
|
||||||
|
podman pod stop ublue-os_forge --ignore
|
||||||
|
echo -e "${GREEN}Done. Have a nice day${ENDCOLOR}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Bash colors
|
||||||
|
RED="\e[31m"
|
||||||
|
YELLOW="\e[33m"
|
||||||
|
GREEN="\e[32m"
|
||||||
|
ENDCOLOR="\e[0m"
|
||||||
|
|
||||||
|
# Main
|
||||||
|
case "$1" in
|
||||||
|
setup)
|
||||||
|
setup
|
||||||
|
;;
|
||||||
|
heat-up)
|
||||||
|
up
|
||||||
|
;;
|
||||||
|
cool-down)
|
||||||
|
down
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid argument: please provide 'heat-up', 'cool-down', or 'setup'"
|
||||||
|
;;
|
||||||
|
esac
|
Loading…
Reference in a new issue