Skip to content

Commit

Permalink
Further tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobSanford committed Aug 14, 2023
1 parent 2a4702e commit 69745ea
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion build/scripts/exportFiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ mkdir -p "$1"

OUTPUT_FILE="$1/files.tar.gz"
/scripts/clearDrupalCache.sh > /dev/null 2>&1
tar -cvpzf "$1/files.tar.gz" --exclude=*.css --exclude=*.css.gz --exclude=*.js --exclude=*.js.gz --exclude=app/html/sites/default/files/php --exclude=app/html/sites/default/files/styles /app/html/sites/default/files > /dev/null 2>&1
cd "$DRUPAL_ROOT/sites/default/files"
tar -cvpzf "$1/files.tar.gz" --exclude=*.css --exclude=*.css.gz --exclude=*.js --exclude=*.js.gz --exclude=./php --exclude=./styles . > /dev/null 2>&1
echo "$OUTPUT_FILE"
4 changes: 2 additions & 2 deletions build/scripts/importContent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ elif [ ! -f "$1" ] ; then
fi

# Import the content.
gunzip $1
EXTRACTED_FILE=$(echo $1 | rev | cut -f 2- -d '.' | rev)
gunzip -c "$1" >/tmp/$EXTRACTED_FILE
echo "Importing $EXTRACTED_FILE"
sh -c "$DRUSH sql-cli < $EXTRACTED_FILE"
sh -c "$DRUSH sql-cli < /tmp/$EXTRACTED_FILE"
$DRUSH cr
4 changes: 3 additions & 1 deletion build/scripts/importData.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ fi
/scripts/importContent.sh "$1/db.sql.gz"

# (Optionally) Import Files.
elif [ -f "$1/files.tar.gz" ] ; then
if [ -f "$1/files.tar.gz" ] ; then
/scripts/importFiles.sh "$1/files.tar.gz"
fi

Echo 'Success!'
2 changes: 1 addition & 1 deletion build/scripts/importFiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ fi
# Import the filesystem archive to the public filesystem.
tar -tzf $1 >/dev/null # Check if the archive is valid.
rm -rf "$DRUPAL_ROOT/sites/default/files/*"
tar -xzf $1 --directory /
tar -xzf $1 --directory "$DRUPAL_ROOT/sites/default/files/"
/scripts/pre-init.d/71_set_public_file_permissions.sh
/scripts/pre-init.d/72_secure_filesystems.sh

0 comments on commit 69745ea

Please sign in to comment.