From 41f248091ef80fda1b165d0b6504ec58cfea76ca Mon Sep 17 00:00:00 2001 From: virusdefender Date: Wed, 27 Dec 2017 22:04:06 +0800 Subject: [PATCH] add replace cdn host function --- deploy/entrypoint.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/deploy/entrypoint.sh b/deploy/entrypoint.sh index e41556fd..37bf799e 100755 --- a/deploy/entrypoint.sh +++ b/deploy/entrypoint.sh @@ -31,6 +31,12 @@ else ln -sf https_redirect.conf http_locations.conf fi +cd $APP/dist +if [ ! -z "$STATIC_CDN_HOST" ]; then + find . -name index.html -exec sed -i "s/link href=\/static/link href=\/\/$STATIC_CDN_HOST\/static/g" {} \; + find . -name index.html -exec sed -i "s/script type=text\/javascript src=\/static/script type=text\/javascript src=\/\/$STATIC_CDN_HOST\/static/g" {} \; +fi + cd $APP n=0