diff --git a/README.md b/README.md index 9917880..927a69c 100644 --- a/README.md +++ b/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 > 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 | diff --git a/forge.sh b/forge.sh new file mode 100755 index 0000000..102b7e2 --- /dev/null +++ b/forge.sh @@ -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 diff --git a/setup.sh b/setup.sh deleted file mode 100755 index 1308f9b..0000000 --- a/setup.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -# Setup Universal Blue Forge -podman play kube forge-pod.yml --build --replace && podman logs --color -f ublue-os_forge-setup.ublue.local