Skip to content
Snippets Groups Projects
Commit 00ce8ea0 authored by Dimitra Chatzichrysou's avatar Dimitra Chatzichrysou
Browse files

Add scripts for drupal operations

parent 9a602bf3
No related branches found
No related tags found
1 merge request!4Add scripts for drupal operations
#!/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
#!/bin/bash
set -exu
# Change working directory to the drupal code
cd /app
# Clean cache
echo "Cleaning cache"
drush cr
#!/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
#!/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
#!/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
#!/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
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment