nuth.ch/scripts/install.sh

37 lines
847 B
Bash
Raw Normal View History

2019-03-25 13:25:09 +00:00
#!/bin/bash
2019-04-13 15:33:06 +00:00
appDir=$(dirname $(dirname $0))
2019-04-10 10:41:33 +00:00
destinationDir=$(pwd)
2019-03-25 13:25:09 +00:00
tempDir=$(mktemp -d)
2019-04-09 18:53:29 +00:00
2019-04-13 15:33:06 +00:00
rsync -a --delete $appDir/ $tempDir
2019-04-10 10:41:33 +00:00
# Cleaning up the built website
find $tempDir \
2019-04-13 15:33:06 +00:00
-mindepth 1 -maxdepth 1 -and \
2019-04-09 18:53:29 +00:00
-name "*" -and \
-not \( \
\( \
2019-04-10 10:41:33 +00:00
-path "$tempDir/app" -or \
-path "$tempDir/public" -or \
-path "$tempDir/themes" \
2019-04-09 18:53:29 +00:00
\) \
-prune \
\) -and \
2019-04-10 10:41:33 +00:00
-not -name ".htaccess" -and \
-not -name "composer.*" \
-exec rm -rf {} +
# Cleaning up the destination directory
find $destinationDir \
2019-04-13 15:33:06 +00:00
-mindepth 1 -maxdepth 1 -and \
2019-04-10 10:41:33 +00:00
-name "*" -and \
-not -name ".env" \
-exec rm -rf {} +
# Copying the built website to the destination
rsync -a $tempDir/ $destinationDir
2019-04-09 18:53:29 +00:00
2019-04-10 10:41:33 +00:00
# Installing the website
cd $destinationDir
composer install
2019-04-13 15:33:06 +00:00
composer exec -- sake dev/build