nuth.ch/scripts/install.sh

40 lines
828 B
Bash
Raw Normal View History

2019-03-25 13:25:09 +00:00
#!/bin/bash
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
sourceDir="."
2019-04-10 10:41:33 +00:00
cd $(dirname $0)
cd ..
rsync -a --delete $sourceDir/ $tempDir
# Cleaning up the built website
find $tempDir \
-mindepth 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 \
-mindepth 1 -and \
-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
./vendor/bin/sake dev/build