From 2f04f6d4ad59179d3650a73be826ba7b5d5b9784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20Borovec?= Date: Thu, 21 Dec 2023 16:41:54 +0100 Subject: [PATCH] better deploy script --- deploy | 8 -------- deploy-local | 16 ++++++++++++++++ deploy-server | 16 ++++++++++++++++ 3 files changed, 32 insertions(+), 8 deletions(-) delete mode 100755 deploy create mode 100755 deploy-local create mode 100755 deploy-server diff --git a/deploy b/deploy deleted file mode 100755 index 9ccb611..0000000 --- a/deploy +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -# Copy the docs and assets directories onto the server -cp -r docs /srv/http -cp -r assets /srv/http - -# Update the header css GET parameter -sed -i "s/TIMESTAMP/"$(date +%s)"/g" /srv/http/docs/common/header.php diff --git a/deploy-local b/deploy-local new file mode 100755 index 0000000..1a2952d --- /dev/null +++ b/deploy-local @@ -0,0 +1,16 @@ +#!/bin/sh + +# Copy the docs and assets directories onto the server +cp -r docs /srv/http +cp -r assets /srv/http + +# Update the header css GET parameter +sed -i "s/TIMESTAMP/"$(date +%s)"/g" /srv/http/docs/common/header.php + +# Replace localhost addresses with proper +find /srv/http/docs -type f -print0 | xargs -0 sed -i 's/https:\/\/www.zdenekborovec.cz/http:\/\/www.zdenekborovec-dev.cz/g' +find /srv/http/docs -type f -print0 | xargs -0 sed -i 's/https:\/\/assets.zdenekborovec.cz/http:\/\/assets.zdenekborovec-dev.cz/g' +find /srv/http/docs -type f -print0 | xargs -0 sed -i 's/https:\/\/zdenekborovec.cz/http:\/\/zdenekborovec-dev.cz/g' +find /srv/http/assets -type f -print0 | xargs -0 sed -i 's/https:\/\/www.zdenekborovec.cz/http:\/\/www.zdenekborovec-dev.cz/g' +find /srv/http/assets -type f -print0 | xargs -0 sed -i 's/https:\/\/assets.zdenekborovec.cz/http:\/\/assets.zdenekborovec-dev.cz/g' +find /srv/http/assets -type f -print0 | xargs -0 sed -i 's/https:\/\/zdenekborovec.cz/http:\/\/zdenekborovec-dev.cz/g' diff --git a/deploy-server b/deploy-server new file mode 100755 index 0000000..5b498eb --- /dev/null +++ b/deploy-server @@ -0,0 +1,16 @@ +#!/bin/sh + +# Copy the docs and assets directories onto the server +cp -r docs /srv/http +cp -r assets /srv/http + +# Update the header css GET parameter +sed -i "s/TIMESTAMP/"$(date +%s)"/g" /srv/http/docs/common/header.php + +# Replace localhost addresses with proper +find /srv/http/docs -type f -print0 | xargs -0 sed -i 's/http:\/\/www.zdenekborovec-dev.cz/https:\/\/www.zdenekborovec.cz/g' +find /srv/http/docs -type f -print0 | xargs -0 sed -i 's/http:\/\/assets.zdenekborovec-dev.cz/https:\/\/assets.zdenekborovec.cz/g' +find /srv/http/docs -type f -print0 | xargs -0 sed -i 's/http:\/\/zdenekborovec-dev.cz/https:\/\/zdenekborovec.cz/g' +find /srv/http/assets -type f -print0 | xargs -0 sed -i 's/http:\/\/www.zdenekborovec-dev.cz/https:\/\/www.zdenekborovec.cz/g' +find /srv/http/assets -type f -print0 | xargs -0 sed -i 's/http:\/\/assets.zdenekborovec-dev.cz/https:\/\/assets.zdenekborovec.cz/g' +find /srv/http/assets -type f -print0 | xargs -0 sed -i 's/http:\/\/zdenekborovec-dev.cz/https:\/\/zdenekborovec.cz/g'