better deploy script

This commit is contained in:
Zdenek Borovec 2023-12-21 16:41:54 +01:00
parent 264057a881
commit 2f04f6d4ad
3 changed files with 32 additions and 8 deletions

8
deploy
View file

@ -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

16
deploy-local Executable file
View file

@ -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'

16
deploy-server Executable file
View file

@ -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'