homeserver/devspace.sh

38 lines
973 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-30 10:50:43 +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-30 11:10:27 +02:00
-v "$PWD:/home/ansible-user/ansible-homeserver" \
-v "$HOME/.git-credentials://home/ansible-user/.git-credentials" \
2024-07-29 16:09:46 +02:00
-w /ansible-homeserver ${IMAGE}
2024-07-29 16:19:06 +02:00
# #credential reinmountern prufen
2024-07-29 16:30:22 +02:00
# touch ff && git add . && gcm && git push
# alles auf user ansible-dev umstellen