homeserver/devspace.sh

30 lines
864 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
RESET='\033[0m' # Text Reset
RED='\033[0;31m' # Red
GREEN='\033[0;32m' # Green
Yellow='\033[0;33m' # Yellow
2024-07-25 23:33:28 +02:00
echo ${GREEN}Run checks...${RESET}
if ! [ -f "./vault-pass" ]; then
echo "${RED}Vault-Pass File is missing!${RESET}"
exit 1
fi
if ! [ -f "./id_ed25519" ]; then
echo "${RED}SSH-Private-Key is missing!${RESET}"
exit 1
fi
echo ${GREEN}Pull image...${RESET}
docker pull --quiet ${IMAGE}
echo ${GREEN}Start session...${RESET}
docker run -it -v $PWD:/ansible-homeserver -w /ansible-homeserver ${IMAGE} /bin/bash && tmux new -t ansible && git rev-parse --abbrev-ref HEAD && git config --global --add safe.directory /ansible-homeserver
2024-07-25 23:36:08 +02:00
# todo shellcheck