homeserver/devspace.sh

33 lines
855 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:36:55 +02:00
RESET='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
2024-07-29 16:16:41 +02:00
YELLOW='\033[0;33m'
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-29 16:13:57 +02:00
if ! [ -f "~/.git-credentials" ]; then
2024-07-29 16:16:41 +02:00
echo -e "${YELLOW}~/.git-credentials not Found!${RESET}"
2024-07-29 16:13:57 +02:00
fi
2024-07-25 23:33:28 +02:00
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-29 16:18:47 +02:00
-v "$HOME/.git-credentials:/root/.git-credentials" \ #credential reinmountern prufen
2024-07-29 16:09:46 +02:00
-w /ansible-homeserver ${IMAGE}