-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
entrypoint.sh
32 lines (25 loc) · 848 Bytes
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
set -e
echo -e "\033[36mSetting up kubectl configuration\033[0m"
mkdir ~/.kube/ || true
if [ -f "~/.kube/config" ]; then
echo -e "\033[36mExisting kubeconfig found, using that and ignoring input\033[0m"
else
echo -e "\033[36mUsing kubeconfig from input\033[0m"
echo "${INPUT_KUBECONFIG}" > ~/.kube/config
fi
echo -e "\033[36mPreparing helm execution\033[0m"
echo "${INPUT_EXEC}" > run.sh
chmod +x ./run.sh
echo -e "\033[36mExecuting helm\033[0m"
helm_output=$(./run.sh)
echo "$helm_output"
delimiter="$(openssl rand -hex 8)"
echo "helm_output<<${delimiter}" >> "${GITHUB_OUTPUT}"
echo "$helm_output" >> "${GITHUB_OUTPUT}"
echo "${delimiter}" >> "${GITHUB_OUTPUT}"
echo -e "\033[36mCleaning up: \033[0m"
rm ./run.sh -Rf
echo -e "\033[36m - exec ✅ \033[0m"
rm ~/.kube/config -Rf
echo -e "\033[36m - kubeconfig ✅ \033[0m"