Commit 51530c2e authored by Dmytro Bogatov's avatar Dmytro Bogatov 💕

Do not build dashboard configs in CI.

parent 47dc37dd
Pipeline #2637 failed with stage
in 55 seconds
......@@ -162,22 +162,28 @@ else
### Dashboard OAuth
echo "Dashboard auth configs..."
# if run from CI, skip
if [ -d "~/.secrets/" ];
then
echo "Dashboard auth configs..."
rm -rf dashboard/
mkdir -p dashboard/dashboard-auth
cp sources/dashboard-auth/*.yaml dashboard/dashboard-auth/
rm -rf dashboard/
mkdir -p dashboard/dashboard-auth
cp sources/dashboard-auth/*.yaml dashboard/dashboard-auth/
COOKIE_SECRET=$(dd if=/dev/urandom bs=16 count=1 2>/dev/null | base64)
COOKIE_SECRET=$(dd if=/dev/urandom bs=16 count=1 2>/dev/null | base64)
sed -i -e "s#__OAUTH2_PROXY_COOKIE_SECRET__#$COOKIE_SECRET#g" dashboard/dashboard-auth/oauth2-proxy.yaml
sed -i -e "s#__OAUTH2_PROXY_CLIENT_SECRET__#$OAUTH2_PROXY_CLIENT_SECRET#g" dashboard/dashboard-auth/oauth2-proxy.yaml
sed -i -e "s#__OAUTH2_PROXY_COOKIE_SECRET__#$COOKIE_SECRET#g" dashboard/dashboard-auth/oauth2-proxy.yaml
sed -i -e "s#__OAUTH2_PROXY_CLIENT_SECRET__#$OAUTH2_PROXY_CLIENT_SECRET#g" dashboard/dashboard-auth/oauth2-proxy.yaml
DASHBOARD_TOKEN=$(kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}') | grep token: )
DASHBOARD_TOKEN="${DASHBOARD_TOKEN:7:${#DASHBOARD_TOKEN}}"
DASHBOARD_TOKEN=$(kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}') | grep token: )
DASHBOARD_TOKEN="${DASHBOARD_TOKEN:7:${#DASHBOARD_TOKEN}}"
sed -i -e "s#__DASHBOARD_TOKEN__#$DASHBOARD_TOKEN#g" dashboard/dashboard-auth/ingreses.yaml
sed -i -e "s#Bearer #Bearer #g" dashboard/dashboard-auth/ingreses.yaml
sed -i -e "s#__DASHBOARD_TOKEN__#$DASHBOARD_TOKEN#g" dashboard/dashboard-auth/ingreses.yaml
sed -i -e "s#Bearer #Bearer #g" dashboard/dashboard-auth/ingreses.yaml
else
echo "~/.secrets/ does not exist. Probably running from CI. Skipping dashboard configs..."
fi
fi
echo "Done!"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment