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

CommentFileSizeAuthor
#4 self-alias.patch722 bytesgreg.1.anderson
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jonhattan’s picture

Component: Config » Core Commands
Category: feature » support
Status: Active » Fixed

You can obtain the alias for the active site with:

drush sa @self --alias-name="foo" --full --with-db

giorgio79’s picture

Awesome thanks!

moshe weitzman’s picture

Nifty. Maybe we should do an example shell alias for that?

greg.1.anderson’s picture

Component: Core Commands » Documentation
Category: support » task
Status: Fixed » Needs review
FileSize
722 bytes

Here's a simple alias that defaults the name to 'new'.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

Maybe we omit the name 'new' and expect people to use an argument? Commit this with or without that.

greg.1.anderson’s picture

Does 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 support self-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.

greg.1.anderson’s picture

Status: Reviewed & tested by the community » Fixed

Went ahead and committed #4.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

k_zoltan’s picture

Version: » All-versions-4.x-dev

Is 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.

k_zoltan’s picture

Issue summary: View changes

iojiojjiojiojiojio;