From b0ace212c421288a557dbbb2c0ff99dd85ff92f9 Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Tue, 30 Apr 2024 13:37:40 +0200 Subject: [PATCH] Update 40-create-ghcred.sh --- 40-create-ghcred.sh | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/40-create-ghcred.sh b/40-create-ghcred.sh index f045e4d..70885a8 100755 --- a/40-create-ghcred.sh +++ b/40-create-ghcred.sh @@ -1,8 +1,21 @@ -#/bin/sh -# create nginx config from evironment +#!/bin/sh + +# Set default value for VUE_APP_PUBLIC_PATH if not provided +# Get VUE_APP_PUBLIC_PATH from Docker endpoint +#VUE_APP_PUBLIC_PATH=$(cat /proc/1/environ | grep VUE_APP_PUBLIC_PATH | cut -d '=' -f2) + +# Copy files with the specified public path +#cp -r /usr/app/dist /usr/share/nginx/html/$VUE_APP_PUBLIC_PATH +echo $VUE_APP_PUBLIC_PATH +ln -s /usr/share/nginx/html /usr/share/nginx/html$VUE_APP_PUBLIC_PATH +#sed -e "//js/++mylocation/js" +sed -i "s+/myAppPlaceholder+$VUE_APP_PUBLIC_PATH+g" /usr/share/nginx/html/index.html +sed -i "s+/myAppPlaceholder+$VUE_APP_PUBLIC_PATH+g" /usr/share/nginx/html/js/app.*.js + +# Create nginx config from environment variables # *prevent envsubst from killing nginx vars with 'tr' and '@'* cat </GH_OAUTH_CLIENT.conf set @CLIENT_ID $CLIENT_ID; set @CLIENT_SECRET $CLIENT_SECRET; -set @CALL_BACK $CALL_BACK -EOT \ No newline at end of file +set @CALL_BACK $CALL_BACK; +EOT