homeserver/devspace.sh

35 lines
927 B
Bash
Raw Normal View History

2024-07-25 23:33:28 +02:00
#!/bin/bash
2024-07-25 23:36:08 +02:00
IMAGE="registry.mgrote.net/ansible-devspace:latest"
2024-07-25 23:33:28 +02:00
# Farben
2024-07-25 23:36:08 +02:00
# https://stackoverflow.com/questions/5947742/how-to-change-the-output-color-of-echo-in-linux
2024-07-25 23:37:45 +02:00
# todo farben kaputt
2024-07-25 23:36:55 +02:00
RESET='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
Yellow='\033[0;33m'
2024-07-25 23:33:28 +02:00
echo ${GREEN}Run checks...${RESET}
2024-07-25 23:37:45 +02:00
# TODO ghier noch check output mit haken dran in grün
2024-07-25 23:33:28 +02:00
if ! [ -f "./vault-pass" ]; then
2024-07-25 23:38:57 +02:00
echo -e "${RED}Vault-Pass File is missing!${RESET}"
2024-07-25 23:33:28 +02:00
exit 1
fi
if ! [ -f "./id_ed25519" ]; then
2024-07-25 23:38:57 +02:00
echo -e "${RED}SSH-Private-Key is missing!${RESET}"
2024-07-25 23:33:28 +02:00
exit 1
fi
2024-07-25 23:38:57 +02:00
echo -e ${GREEN}Pull image...${RESET}
2024-07-25 23:33:28 +02:00
docker pull --quiet ${IMAGE}
2024-07-25 23:38:57 +02:00
echo -e ${GREEN}Start session...${RESET}
2024-07-25 23:45:23 +02:00
docker run -it \
-v $PWD:/ansible-homeserver \
-w /ansible-homeserver ${IMAGE} \
/bin/bash echo Branch: $(git rev-parse --abbrev-ref HEAD) && git config --global --add safe.directory /ansible-homeserver && /bin/bash
2024-07-25 23:36:08 +02:00
# todo shellcheck