diff --git a/deploy.sh b/deploy.sh index 7eda1ea..635cedd 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,14 +1,11 @@ #!/bin/bash -directory="site" -if [ ! -d "$directory" ]; then - echo "Directory does not exist." - exit 1 -fi - -cd "$directory" || exit 1 +dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" +pushd $dir > /dev/null +pushd site find . -type f -name "*.html" -print0 | while IFS= read -r -d $'\0' file; do sed -i 's/href="index\.html"/href="index-old.html"/g' "$file" done echo "Replacement complete." +popd mv site/index.html site/index-old.html mv site/index-new.html site/index.html \ No newline at end of file diff --git a/docker/control.sh b/docker/control.sh index f2d5753..96030d8 100755 --- a/docker/control.sh +++ b/docker/control.sh @@ -29,10 +29,8 @@ pushd $dir > /dev/null case "$1" in start) - pushd $dir/.. git pull - ./deploy.sh - popd + ../deploy.sh docker-compose -p heisse-preise -f docker-compose.base.yml -f docker-compose.prod.yml build docker-compose -p heisse-preise -f docker-compose.base.yml -f docker-compose.prod.yml up -d ;;