example.aliases.drushrc.php 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <?php
  2. /**
  3. * Example of valid statements for an alias file. Use this
  4. * file as a guide to creating your own aliases.
  5. *
  6. * Aliases are commonly used to define short names for
  7. * local or remote Drupal installations; however, an alias
  8. * is really nothing more than a collection of options.
  9. * A canonical alias named "dev" that points to a local
  10. * Drupal site named "dev.mydrupalsite.com" looks like this:
  11. *
  12. * $aliases['dev'] = array(
  13. * 'root' => '/path/to/drupal',
  14. * 'uri' => 'dev.mydrupalsite.com',
  15. * );
  16. *
  17. * With this alias definition, then the following commands
  18. * are equivalent:
  19. *
  20. * $ drush @dev status
  21. * $ drush --root=/path/to/drupal --uri=dev.mydrupalsite.com status
  22. *
  23. * Any option that can be placed on the drush commandline
  24. * can also appear in an alias definition.
  25. *
  26. * There are several ways to create alias files.
  27. *
  28. * + Put each alias in a separate file called ALIASNAME.alias.drushrc.php
  29. * + Put multiple aliases in a single file called aliases.drushrc.php
  30. * + Put groups of aliases into files called GROUPNAME.aliases.drushrc.php
  31. *
  32. * Drush will search for aliases in any of these files using
  33. * the alias search path. The following locations are examined
  34. * for alias files:
  35. *
  36. * 1. In any path set in $options['alias-path'] in drushrc.php,
  37. * or (equivalently) any path passed in via --alias-path=...
  38. * on the command line.
  39. * 2. If 'alias-path' is not set, then in one of the default
  40. * locations:
  41. * a. /etc/drush
  42. * b. In the drush installation folder
  43. * c. Inside the 'aliases' folder in the drush installation folder
  44. * d. $HOME/.drush
  45. * 3. Inside the sites folder of any bootstrapped Drupal site,
  46. * or any local Drupal site indicated by an alias used as
  47. * a parameter to a command
  48. *
  49. * Files stored in these locations can be used to create aliases
  50. * to local and remote Drupal installations. These aliases can be
  51. * used in place of a site specification on the command line, and
  52. * may also be used in arguments to certain commands such as
  53. * "drush rsync" and "drush sql-sync".
  54. *
  55. * Alias files that are named after the single alias they contain
  56. * may use the syntax for the canoncial alias shown at the top of
  57. * this file, or they may set values in $options, just
  58. * like a drushrc.php configuration file:
  59. *
  60. * $options['uri'] = 'dev.mydrupalsite.com',
  61. * $options['root'] = '/path/to/drupal';
  62. *
  63. * When alias files use this form, then the name of the alias
  64. * is taken from the first part of the alias filename.
  65. *
  66. * Alias groups (aliases stored together in files called
  67. * GROUPNAME.aliases.drushrc.php, as mentioned above) also
  68. * create an implicit namespace that is named after the group
  69. * name.
  70. *
  71. * For example:
  72. *
  73. * # File: mysite.aliases.drushrc.php
  74. * $aliases['dev'] = array(
  75. * 'root' => '/path/to/drupal',
  76. * 'uri' => 'dev.mydrupalsite.com',
  77. * );
  78. * $aliases['live'] = array(
  79. * 'root' => '/other/path/to/drupal',
  80. * 'uri' => 'mydrupalsite.com',
  81. * );
  82. *
  83. * Then the following special aliases are defined:
  84. *
  85. * @mysite An alias named after the groupname
  86. * may be used to reference all of the
  87. * aliases in the group (e.g. drush @mydrupalsite status)
  88. *
  89. * @mysite.dev A copy of @dev
  90. *
  91. * @mysite.live A copy of @live
  92. *
  93. * Thus, aliases defined in an alias group file may be referred to
  94. * either by their simple (short) name, or by thier full namespace-qualified
  95. * name.
  96. *
  97. * To see an example alias definition for the current bootstrapped
  98. * site, use the "site-alias" command with the built-in alias "@self":
  99. *
  100. * $ drush site-alias @self
  101. *
  102. * If you would like to see all of the Drupal sites at a specified
  103. * root directory, use the built-in alias "@sites":
  104. *
  105. * $ drush -r /path/to/drupal site-alias @sites
  106. *
  107. * See 'drush help site-alias' for more options for displaying site
  108. * aliases.
  109. *
  110. * Although most aliases will contain only a few options, a number
  111. * of settings that are commonly used appear below:
  112. *
  113. * - 'uri': This should always be the same as the site's folder name
  114. * in the 'sites' folder.
  115. * - 'root': The Drupal root; must not be specified as a relative path.
  116. * - 'remote-port': If the database is remote and 'db-url' contains
  117. * a tunneled port number, put the actual database port number
  118. * used on the remote machine in the 'remote-port' setting.
  119. * - 'remote-host': The fully-qualified domain name of the remote system
  120. * hosting the Drupal instance. The remote-host option must be
  121. * omitted for local sites, as this option controls whether or not
  122. * rsync parameters are for local or remote machines.
  123. * - 'remote-user': The username to log in as when using ssh or rsync.
  124. * - 'ssh-options': If the target requires special options, such as a non-
  125. * standard port, alternative identity file, or alternative
  126. * authentication method, ssh- options can contain a string of extra
  127. * options that are used with the ssh command, eg "-p 100"
  128. * - 'parent': The name of a parent alias (e.g. '@server') to use as a basis
  129. * for this alias. Any value of the parent will appear in the child
  130. * unless overridden by an item with the same name in the child.
  131. * Multiple inheritance is possible; name multiple parents in the
  132. * 'parent' item separated by commas (e.g. '@server,@devsite').
  133. * - 'db-url': The Drupal 6 database connection string from settings.php.
  134. * For remote databases accessed via an ssh tunnel, set the port
  135. * number to the tunneled port as it is accessed on the local machine.
  136. * If 'db-url' is not provided, then drush will automatically look it
  137. * up, either from settings.php on the local machine, or via backend invoke
  138. * if the target alias specifies a remote server.
  139. * - 'databases': Like 'db-url', but contains the full Drupal 7 databases
  140. * record. Drush will look up the 'databases' record if it is not specified.
  141. * - 'path-aliases': An array of aliases for common rsync targets.
  142. * Relative aliases are always taken from the Drupal root.
  143. * '%drush-script': The path to the 'drush' script, or to 'drush.php' or
  144. * 'drush.bat', as desired. This is used by backend invoke when drush
  145. * runs a drush command. The default is 'drush' on remote machines, or
  146. * the full path to drush.php on the local machine.
  147. * '%drush': A read-only property: points to the folder that the drush script
  148. * is stored in.
  149. * '%dump-dir': Path to directory that "drush sql-sync" should use to store
  150. * sql-dump files. Helpful filenames are auto-generated.
  151. * '%dump': Path to the file that "drush sql-sync" should use to store sql-dump file.
  152. * '%files': Path to 'files' directory. This will be looked up if not specified.
  153. * '%root': A reference to the Drupal root defined in the 'root' item
  154. * in the site alias record.
  155. * - 'command-specific': These options will only be set if the alias
  156. * is used with the specified command. In the example below, the option
  157. * `--no-cache` will be selected whenever the @stage alias
  158. * is used in any of the following ways:
  159. * drush @stage sql-sync @self @live
  160. * drush sql-sync @stage @live
  161. * drush sql-sync @live @stage
  162. * In case of conflicting options, command-specific options in targets
  163. * (source and destination) take precedence over command-specific options
  164. * in the bootstrapped site, and command-specific options in a destination
  165. * alias will take precedence over those in a source alias.
  166. * - 'source-command-specific' and 'target-command-specific': Behaves exactly
  167. * like the 'command-specific' option, but is applied only if the alias
  168. * is used as the source or target, respectively, of an rsync or sql-sync
  169. * command. In the example below, `--skip-tables-list=comments` whenever
  170. * the alias @live is the target of an sql-sync command, but comments will
  171. * be included if @live is the source for the sql-sync command.
  172. * Some examples appear below. Remove the leading hash signs to enable.
  173. */
  174. #$aliases['stage'] = array(
  175. # 'uri' => 'stage.mydrupalsite.com',
  176. # 'root' => '/path/to/remote/drupal/root',
  177. # 'db-url' => 'pgsql://username:password@dbhost.com:port/databasename',
  178. # 'remote-host' => 'mystagingserver.myisp.com',
  179. # 'remote-user' => 'publisher',
  180. # 'path-aliases' => array(
  181. # '%drush' => '/path/to/drush',
  182. # '%drush-script' => '/path/to/drush/drush',
  183. # '%dump-dir' => '/path/to/dumps/',
  184. # '%files' => 'sites/mydrupalsite.com/files',
  185. # '%custom' => '/my/custom/path',
  186. # ),
  187. # 'command-specific' => array (
  188. # 'sql-sync' => array (
  189. # 'no-cache' => TRUE,
  190. # ),
  191. # ),
  192. # );
  193. #$aliases['dev'] = array(
  194. # 'uri' => 'dev.mydrupalsite.com',
  195. # 'root' => '/path/to/drupal/root',
  196. # );
  197. #$aliases['server'] = array(
  198. # 'remote-host' => 'mystagingserver.myisp.com',
  199. # 'remote-user' => 'publisher',
  200. # );
  201. #$aliases['live'] = array(
  202. # 'parent' => '@server,@dev',
  203. # 'uri' => 'mydrupalsite.com',
  204. # 'target-command-specific' => array (
  205. # 'sql-sync' => array (
  206. # 'skip-tables-list' => 'comments',
  207. # ),
  208. # ),
  209. # );