You are here

Docksal for www.altagrade.com

Submitted by Alan Mels on Wed, 06/24/2020 - 07:17

Make sure to place the following line in sites/default/settings.local.php:

  1. $base_url = 'https://www.altagrade.docksal';

0) Content of /home/docker/.bash_aliases

function pull-db() {
  cd /var/www/docroot
  drush -y sql-sync @prod @dev
  drush -y en search_krumo 
  drush vset error_level 2
  yes | drush -y en drush_extras
  drush -y en devel permissions_variable
  drush -y block-configure --module=devel --delta=switch_user --region=footer_firstcolumn --weight=0
  drush -y dis memcache
  drush -y dis varnish memcache_admin && drush -y dis masquerade memcache emaillog nicemessages
  drush uli 1
}
 
alias pull-private='drush -y rsync @prod:%private @dev:%private'
alias pull-theme='drush -y rsync @prod:%theme @dev:%theme'
alias pull-custom='drush -y rsync @prod:%modules @dev:%modules'
alias pull-files='drush -y rsync @prod:%files @dev:%files'
alias pull-all='drush -y rsync --exclude-conf @prod @dev'
alias push-theme='drush -y rsync @dev:%theme @prod:%theme'
alias push-modules='drush -y rsync @dev:%modules @prod:%modules'
 
alias modules='cd /var/www/docroot/sites/default/modules'
alias theme='cd /var/www/docroot/sites/default/themes/altagrade'
 
export EDITOR="nano"
 
alias eba='nano ~/.bash_aliases'
alias lba='source ~/.bash_aliases'
alias ?='history'  # DISPLAYS HISTORY
alias x='exit'
alias yum='yum -y'
alias recall="history |grep $1"
 
tardir () {
tar cvzf ${1}.tgz ${1}
}
 
# Extract compressed file
extract () {
  if [ -f $1 ] && [ -r $1 ] ; then
    case $1 in
      (*.tar.bz|*.tbz)  tar -xjf $1;;
      (*.tar.bz2|*.tbz2)  tar xjf $1;;
      (*.tar.gz|*.tgz)    tar xzf $1;;
      (*.bz2)             bunzip2 $1;;
      (*.rar)             rar x $1;;
      (*.gz)              gunzip $1;;
      (*.tar)             tar xf $1;;
      (*.zip)             unzip $1;;
      (*.Z)               uncompress $1;;
      (*.7z)              7z x $1;;
      (*.deb)             sudo dpkg -i $1;;
      (*.rpm)             sudo alien -dik $1;;
      (*)                 echo "extract: unsupported format $1" ;;
  esac
    rm -rf $1
    ls -l
  else
    echo "extract: file not found or unreadable: $1"
  fi
}
 
# Find a file with a pattern in file name
function fn() { find . -type f -iname '*'$1'*' -ls ; }
# Find a file with a pattern in the content of the file
function fs() { grep -Ril "$1" .; }

1) cat ~/.drush/my.aliases.drushrc.php

<?php
 
/**
 * @file yoursite.aliases.drushrc.php
 * Site aliases for [your site domain]
 * Place this file at ~/.drush/  (~/ means your home path)
 *
 * Usage:
 *   To copy the development database to your local site:
 *   $ drush sql-sync @yoursite.dev @yoursite.local
 *   To copy your local database to the development site:
 *   $ drush sql-sync @yoursite.local @yoursite.dev --structure-tables-key=common --no-ordered-dump --sanitize=0 --no-cache
 *   To copy the production database to your local site:
 *   $ drush sql-sync @yoursite.prod @yoursite.local
 *   To copy all files in development site to your local site:
 *   $ drush rsync @yoursite.dev:%files @yoursite.local:%files
 *   Clear the cache in production:
 *   $ drush @yoursite.prod clear-cache all
 *
 * You can copy the site alias configuration of an existing site into a file
 * with the following commands:
 *   $ cd /path/to/settings.php/of/the/site/
 *   $ drush site-alias @self --full --with-optional >> ~/.drush/mysite.aliases.drushrc.php
 * Then edit that file to wrap the code in < ? php ? > tags.
 */
 
/**
 * Local alias
 * Set the root and site_path values to point to your local site
 */
 
$aliases['dev'] = array (
  'root' => '/var/www/docroot',
  'uri' => 'altagrade.docksal',
  'path-aliases' =>
  array (
    '%drush' => '/usr/local/bin',
    '%sites' => 'sites',
    '%modules' => 'sites/default/modules',
    '%theme' => 'sites/default/themes/altagrade',
  ),
);
 
$aliases['prod'] = array (
  'uri' => 'www.altagrade.com',
  'root' => '/home/altacom/public_html',
  'remote-user' => 'altacom',
  'remote-host' => '66.160.206.201',
  'ssh-options'  => '-p 19753',  // To change the default port on remote server
  'path-aliases' => array(
    '%sites' => 'sites',
    '%dump-dir' => '/tmp',
    '%modules' => 'sites/default/modules',
    '%theme' => 'sites/default/themes/altagrade',
  ),
  'source-command-specific' => array (
    'sql-sync' => array (
      'no-cache' => TRUE,
      'structure-tables-key' => 'common',
    ),
  ),
  // No need to modify the following settings
  'command-specific' => array (
    'sql-sync' => array (
      'sanitize' => TRUE,
      'no-ordered-dump' => TRUE,
      'structure-tables' => array(
       // You can add more tables which contain data to be ignored by the database dump
        'common' => array('cache', 'cache_filter', 'cache_menu', 'cache_page', 'history', 'sessions', 'watchdog'),
      ),
    ),
  ),
);
 
?>