diff --git a/scripts/check-if-installed..sh b/scripts/check-if-installed..sh new file mode 100644 index 0000000000000000000000000000000000000000..9f4787adf48f6b9684dcc69d838e2bfcb28e6f66 --- /dev/null +++ b/scripts/check-if-installed..sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -exu + +# Change working directory to the drupal code +cd /app + +# Check if Drupal site is installed +echo "Checking if Drupal site is installed" +drush status bootstrap | grep -q Successful + +# Make sure we get a successful response + if [$? -ne 0]; then + echo "Drupal is not installed" >&2 + exit 1 + fi + exit 0 diff --git a/scripts/clear-cache.sh b/scripts/clear-cache.sh new file mode 100755 index 0000000000000000000000000000000000000000..a8ce047532ec243fdf6e940aaaea428b055277a3 --- /dev/null +++ b/scripts/clear-cache.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -exu + +# Change working directory to the drupal code +cd /app + +# Clean cache +echo "Cleaning cache" +drush cr diff --git a/scripts/database-backup.sh b/scripts/database-backup.sh new file mode 100755 index 0000000000000000000000000000000000000000..076a5306bd5e8fe6a296dfdc8494f906d0e1460b --- /dev/null +++ b/scripts/database-backup.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -exu + +# Change working directory to the drupal code +cd /app + +# Database backup +echo "Database backup" +drush sql-dump > /drupal-data/dbdump.sql diff --git a/scripts/database-restore.sh b/scripts/database-restore.sh new file mode 100755 index 0000000000000000000000000000000000000000..74f838a6300041f920404dd7399809f7c62021fc --- /dev/null +++ b/scripts/database-restore.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -exu + +# Change working directory to the drupal code +cd /app + +# Database drop +echo "Database drop" +drush sql-drop -y + +# Database restore +echo "Database restore" +`drush sql-connect` < /drupal-data/dbdump.sql diff --git a/scripts/disable-maintenance-mode.sh b/scripts/disable-maintenance-mode.sh new file mode 100755 index 0000000000000000000000000000000000000000..98f565335931d15120ed496430fe1c74ce982d1d --- /dev/null +++ b/scripts/disable-maintenance-mode.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -exu + +# Change working directory to the drupal code +cd /app + +# Disable maintenance mode +echo "Disabling maintenance mode" +drush state:set system.maintenance_mode 0 --input-format=integer +drush cache:rebuild diff --git a/scripts/enable-maintenance-mode.sh b/scripts/enable-maintenance-mode.sh new file mode 100755 index 0000000000000000000000000000000000000000..b1ebc319689442f96090eb5529c551f631360d61 --- /dev/null +++ b/scripts/enable-maintenance-mode.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -exu + +# Change working directory to the drupal code +cd /app + +# Enable maintenance mode +echo "Enabling maintenance mode" +drush state:set system.maintenance_mode 1 --input-format=integer +drush cache:rebuild diff --git a/scripts/site-install.sh b/scripts/site-install.sh new file mode 100644 index 0000000000000000000000000000000000000000..3b707db59424441b56d5bafcf4e161dd74e53356 --- /dev/null +++ b/scripts/site-install.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -exu + +# Change working directory to the drupal code +cd /app + +# Install Drupal site +echo "Installing Drupal site" +drush site-install -y --config-dir=../config/sync --account-name=admin --account-pass=pass --account-mail=admin@example.com