Skip to content

Instantly share code, notes, and snippets.

@davidneedham
Last active August 29, 2015 14:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidneedham/0a82e5ef1278f5185ea5 to your computer and use it in GitHub Desktop.
Save davidneedham/0a82e5ef1278f5185ea5 to your computer and use it in GitHub Desktop.
Example site alias file
<?php
// VARIABLES
// Where all of your local sites are located.
// [I'm using MAMP.]
$local_sites = '/Applications/MAMP/htdocs/';
// Where all of your remote sites are located.
// [This is usually where you land when you first SSH in.]
$remote_sites = '/home/example/';
// Where the specific Live website is.
// [This is usually a folder within public_html.]
$live_site = '/home/example/public_html/example.com/';
// Where the specific Almost website is.
// [This is usually a folder within public_html.]
$almost_site = '/home/example/public_html/almost.example.com/';
// SITE ALIAS: LOCAL (@example.local)
$aliases['local'] = array(
// Where you go in your browser to visit the site.
'uri' => 'example.dev',
// Where the local Drupal site is located.
// [/Applications/MAMP/htdocs/example]
'root' => $local_sites . 'example',
// Other aliases in the path (via @example.local:%...)
'path-aliases' => array(
// Where Drupal should dump the database.
// [Used with sql-dump.]
'%dump-dir' => $local_sites . 'drush-dumps',
// Where Drupal's public files are located.
// [@example.local:%files]
'%files' => $local_sites . 'example/sites/default/files'
)
);
// SITE ALIAS: LIVE (@example.live)
// [This may be called Remote, Prod, or something else.]
$aliases['live'] = array (
// Where you go in your browser to visit the site.
'uri' => 'example.com',
// Where the live Drupal site is located on the server.
// [/home/example/public_html/example.com]
'root' => $live_site,
// The host you use to SSH to the server.
'remote-host' => 'example.com',
// The user you use to SSH to the server.
// [If you set this in .ssh/config, you don't need this.]
'remote-user' => 'example',
// Define a port or other SSH options.
// [If you set this in .ssh/config, you don't need this.]
'ssh-options' => "-p 22",
// Other aliases in the path (via @example.live:%...)
'path-aliases' => array(
// Where Drupal should dump the database.
// [Used with sql-dump.]
'%dump-dir' => $remote_sites . 'drush-dumps',
// If Drupal uses the private file strucutre, say where that is.
// [@example.live:%privatefiles]
'%privatefiles' => $remote_sites . 'privatefiles/live',
// Where Drupal's public files are located.
// [@example.live:%files]
'%files' => $live_site . 'sites/default/files',
)
);
// SITE ALIAS: ALMOST (@example.almost)
// [This may be called Almost, Dev, Staging, or anything.]
$aliases['almost'] = array (
// Where you go in your browser to visit the site.
'uri' => 'almost.example.com',
// Where the live Drupal site is located on the server.
// [/home/example/public_html/almost.example.com]
'root' => $almost_site,
// Rather than redefine the SSH settings, set the parent alias.
'parent' => '@example.live',
// Other aliases in the path (via @example.almost:%...)
'path-aliases' => array(
// Where Drupal should dump the database.
// [Used with sql-dump.]
'%dump-dir' => $remote_sites . 'drush-dumps',
// If Drupal uses the private file strucutre, say where that is.
// [@example.almost:%privatefiles]
'%privatefiles' => $remote_sites . 'privatefiles/almost',
// Where Drupal's public files are located.
// [@example.almost:%files]
'%files' => $almost_site . 'sites/default/files',
)
);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment