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:36:55 +02:00
|
|
|
RESET='\033[0m'
|
|
|
|
RED='\033[0;31m'
|
|
|
|
GREEN='\033[0;32m'
|
2024-07-25 23:33:28 +02:00
|
|
|
|
2024-07-25 23:49:19 +02:00
|
|
|
echo -e "${GREEN}Run checks...${RESET}"
|
2024-07-25 23:33:28 +02:00
|
|
|
|
2024-07-25 23:49:19 +02:00
|
|
|
# TODO hier 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-26 00:42:22 +02:00
|
|
|
docker pull ${IMAGE}
|
2024-07-25 23:33:28 +02:00
|
|
|
|
2024-07-25 23:45:23 +02:00
|
|
|
docker run -it \
|
2024-07-26 00:47:16 +02:00
|
|
|
-v "$PWD:/ansible-homeserver" \
|
2024-07-25 23:45:23 +02:00
|
|
|
-w /ansible-homeserver ${IMAGE} \
|
2024-07-25 23:58:09 +02:00
|
|
|
/bin/bash -c "git config --global --add safe.directory /ansible-homeserver && /bin/bash"
|
2024-07-25 23:36:08 +02:00
|
|
|
|
|
|
|
# todo shellcheck
|