Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Would love to be able to create drush aliases for the current drupal installation easily with a drush command. All the information is already available like system path, and db login / pass in settings.php, so drush could easily copy it and place the alias file at the right place. Found sg similar but for Vagrant integration #1744154: Create site aliases automatically
Comment | File | Size | Author |
---|---|---|---|
#4 | self-alias.patch | 722 bytes | greg.1.anderson |
Comments
Comment #1
jonhattanYou can obtain the alias for the active site with:
drush sa @self --alias-name="foo" --full --with-db
Comment #2
giorgio79 CreditAttribution: giorgio79 commentedAwesome thanks!
Comment #3
moshe weitzman CreditAttribution: moshe weitzman commentedNifty. Maybe we should do an example shell alias for that?
Comment #4
greg.1.anderson CreditAttribution: greg.1.anderson commentedHere's a simple alias that defaults the name to 'new'.
Comment #5
moshe weitzman CreditAttribution: moshe weitzman commentedMaybe we omit the name 'new' and expect people to use an argument? Commit this with or without that.
Comment #6
greg.1.anderson CreditAttribution: greg.1.anderson commentedDoes the site-aliases feature support argument-to-option conversion? If I remember correctly, it works like bash aliases, and appends arguments to the end of the expanded command line. If that's the case, then we could expect people to type
self-alias --alias-name="myname"
, but we could not supportself-alias myname
.The former works even if there is a default --alias-name in the site alias. Without the --alias-name in the site alias, the name would default to "self". I put the --alias-name in the definition to document the option.
Comment #7
greg.1.anderson CreditAttribution: greg.1.anderson commentedWent ahead and committed #4.
Comment #9
k_zoltan CreditAttribution: k_zoltan commentedIs there any way to reference to the actual folder as an alias even if its an empty folder.
I think this would make sense when creating a test environement of a live site
mkdir testlive
cd testlive
drush rsync @live . <----- not this is where I don't know how to reference
@current
. simply a dot
@self -> this doesn't work since it's an empty folder error message Could not evaluate destination path @self.
Comment #9.0
k_zoltan CreditAttribution: k_zoltan commentediojiojjiojiojiojio;