40 lines
828 B
Bash
Executable file
40 lines
828 B
Bash
Executable file
#!/bin/bash
|
|
destinationDir=$(pwd)
|
|
tempDir=$(mktemp -d)
|
|
sourceDir="."
|
|
|
|
cd $(dirname $0)
|
|
cd ..
|
|
|
|
rsync -a --delete $sourceDir/ $tempDir
|
|
|
|
# Cleaning up the built website
|
|
find $tempDir \
|
|
-mindepth 1 -and \
|
|
-name "*" -and \
|
|
-not \( \
|
|
\( \
|
|
-path "$tempDir/app" -or \
|
|
-path "$tempDir/public" -or \
|
|
-path "$tempDir/themes" \
|
|
\) \
|
|
-prune \
|
|
\) -and \
|
|
-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
|
|
|
|
# Installing the website
|
|
cd $destinationDir
|
|
composer install
|
|
./vendor/bin/sake dev/build |