Skip directly to content

Drush site alias groups

on Mon, 05/30/2011 - 19:08

Continuing from the last blog where we started using aliases for drush, we are going to group aliases together as keep things organized. Using our example from last time we could build aliases for a development, staging and live site so we can use commands such as drush sql-sync @live @stage to sync up the database from the live site to the staging site. This is a great idea but what happens when we take on another project such as herdrupalsite.com.

First we are going to setup our mds aliases so we have our three instances:
~/.drushrc/mds.aliases.drushrc.php

$aliases['dev'] = array(
'uri' => 'dev.mydrupalsite.com',
'root' => '/var/www/mydrupalsite.com',
'db-url' => 'mysql://username:password@dev.dbhost.com:port/mydrupalsite',
'path-aliases' => array(
'%dump-dir' => '/path/to/dumps/',
),
'command-specific' => array (
'sql-sync' => array (
'no-cache' => TRUE,
),
),
);
$aliases['stage'] = array(
'uri' => 'stage.mydrupalsite.com',
'root' => '/var/www/mydrupalsite.com',
'db-url' => 'mysql://username:password@stage.dbhost.com:port/mydrupalsite',
'remote-host' => 'stage.mydrupalsite.com',
'remote-user' => 'superdev',
'path-aliases' => array(
'%dump-dir' => '/path/to/dumps/',
),
'command-specific' => array (
'sql-sync' => array (
'no-cache' => TRUE,
),
),
);
$aliases['live'] = array(
'uri' => 'mydrupalsite.com',
'root' => '/var/www/mydrupalsite.com',
'db-url' => 'mysql://username:password@dbhost.com:port/mydrupalsite',
'remote-host' => 'mydrupalsite.com',
'remote-user' => 'superdev',
'path-aliases' => array(
'%dump-dir' => '/path/to/dumps/',
),
'command-specific' => array (
'sql-sync' => array (
'no-cache' => TRUE,
),
),
);

Now with this we can call drush sql-sync @mds.live @mds.stage --sanitize. As you can see here, since the file is named mds.aliases.drushrc.php that will be the first part of the alias and the second part will be the aliases key. Now we can create a new file called hds.aliases.drushrc.php and use the same keys just so we can keep them organized. This also allows us to call the main alias like drush @mds status and have drush call the status command on all the alias keys in that alias group.

This is super useful and very helpful in allowing us to call different scripts among sites in the same group. To check to see what modules are enabled you could use drush @mds pml --type=module --status=enabled in a script and compare the modules and their release version just to make sure you are running the same modules on all sites in the development cycle.

There is another setting that we can use in our aliases to make things easier, the parent variable will allow you to extend an alias and overwrite its values. This can be used to keep those variables that are common among aliases in a common place.
~/.drushrc/mds.aliases.drushrc.php

$aliases['defaults'] = array(
'root' => '/var/www/mydrupalsite.com',
'remote-user' => 'superdev',
'path-aliases' => array(
'%dump-dir' => '/path/to/dumps/',
),
'command-specific' => array (
'sql-sync' => array (
'no-cache' => TRUE,
),
),
);
$aliases['dev'] = array(
'parent' => '@mds.defaults',
'uri' => 'dev.mydrupalsite.com',
'db-url' => 'mysql://username:password@dev.dbhost.com:port/mydrupalsite',
);
$aliases['stage'] = array(
'parent' => '@mds.defaults',
'uri' => 'stage.mydrupalsite.com',
'db-url' => 'mysql://username:password@stage.dbhost.com:port/mydrupalsite',
'remote-host' => 'stage.mydrupalsite.com',
);
$aliases['live'] = array(
'parent' => '@mds.defaults',
'uri' => 'mydrupalsite.com',
'db-url' => 'mysql://username:password@dbhost.com:port/mydrupalsite',
'remote-host' => 'mydrupalsite.com',
'remote-user' => 'superdev2',
);

Here we are using the drupal root, path aliases, and command specific settings as our defaults and setting the @mds.defaults as the parent to be extended for each alias in the flie. This allows for easier administration of this file so we only have to make changes in a single place.

Comments

Thanks a lot for sharing this with all folks you really recognise what
you are speaking about! Bookmarked. Kindly additionally consult with my website =).
We could have a link trade agreement among us

Hmm is anyone else experiencing problems with the pictures on this blog loading?

I'm trying to figure out if its a problem on my end or if it's the blog.
Any responses would be greatly appreciated.

Here is my page; [url=http://iitd.info/ganhardinheironainternet58073]ganhar dinheiro na
internet[/url]

I visited various web sites except the audio quality for audio songs existing at this web page
is in fact marvelous.

my web blog - [url=https://www.facebook.com/pages/Destroy-Depression-System-on-FB/152786897... depression system Review[/url]

Kindly additionally consult with my website gejala awal kanker rahim

Hello, I enjoy reading through your article post.
I wanted to write a little comment to support you.

Also visit my web site [url=https://www.linkedin.com/pub/russell-crosby/6/4a1/8a2]Financial Solutions[/url]

A very nice and helpful tutorial who want to learn aliases for drush good effort and now am gonna share this blog on my website so my students of buy an assignment uk can learn many things from your blog

Programming has become very much important in various I.T fields and it is very difficult as well because it requires creative thinking and new ideas of assignment websites. People who do not know even ABC of this they must read this blog because in its content there are some samples are given which can be helpful for them to develop understandings and to see pattern.

Hello, I enjoy reading through your article post. I wanted to write a little comment to support you.
management assignment uk

thanks for the description.I'm trying to figure out if its a problem on my end or if it's the blog.Any responses would be greatly appreciated.
Essay writer online

how good information have on this page.. for make money online I will tell you my experience.
Obat tradisional keputihan menahun
Obat tradisional kista coklat
Obat tradisional kanker kelenjar getah bening stadium 4

A friend revealed me his earnings on internet just filling surveys, I didn't believe him until I tested the system on my own and now I'm earning very good money, it is so exciting!
Obat tradisional untuk menghilangkan lipoma
Obat tradisional mioma uteri
Obat tradisional flek paru paru

Thanks for sharing post. It is really good one which provide enough information to explore about given topic. Good luck.
https://www.cheap-essay-writing.co.uk/

gud artical!!

With the sql-sync authority you be able to also use the disinfect alternative to difficult to understand the email addresses in the user bench and stop by chance emailing all the users in your file when you are difficult persons forms! Please visit our webpage needpaperhelp.com

This is really very informative blog which I have found luckily while searching something similar on the net.

A drush pseudonym is basically an alternate way to a remote Drupal site. It is basically a passage through which drush charges can be issued.
http://www.courseworkbuzz.co.uk/

Ϝrank Breinling is a recogniᴢed expert in Affiliate Marketing.
The financial гepߋrts may include profit-and-loss statements and
expense reports. The confliϲt arises when a certain goal iѕs achieved but the return never sedems to
be at the same level of your expectations.

Here is mу web-sitе ... [url=http://charamcgou.Buzznet.com/user/journal/24794230/pain-ft-lauderdale-c...
in fort Laudеrdale[/url]

When ᥙsing sսch a solution, you will be asked to talk about the eѵents that
affeϲted you in the year, marriage, new baby, move tо a new house,
started college, changed employment status, etc. But
there is an exception if the caregiver is your parent. This methoɗ ρts are crucial іnside working
with a defined tаlent management stгategy.

Fеel free to surf to my web site: [url=http://Margartk13947668.soup.io/?sessid=916003a11630b0437efcf953023cd2c0... Raton CPA
jobs in Florida[/url]

perhaps this is the best page for me and very useful article. with their greatly helped me in getting one of the very valuable science.
manfaat
obat
cara

jelly gamat luxor want say Thanks for your feedback! Yes, it's already planned to look into supporting project administrators in addition to global administrators and user permissions & roles we already have. This is a complex feature because project administrators not only need to able to configure project access and some project settings. TestRail also allows you to configure many other settings (such as custom field options or the new template feature) on a per-project basis and this needs to be covered as well. But it's already planned to look into this and I'm happy to add another vote to this feature request, thanks again for cara pemesanan jelly gamat luxor

harga qnc jelly gamat di apotik Thanks for your posting! The three-pane view can be found on the test suite/case and run pages and can be activated by clicking on the little expand icon on the right when you hover over a case or test qnc jelly gamat

Specific line of codes and its nicely coded buy twitter favorites. I think I can also study and make my own codes out of this coded codes buy twitter retweets.

Thanks for the information, Very useful
minum es teh meningkatkan resiko batu ginjal

What a greatly written article.Thanks for sharing. iPhone 7 release date USA Netflix Vs Hulu Pluswww.gmail.com

Квартиры в Новосибирске Продажа, аренда, обмен квартир. Большой выбор предложений. Поможем собственникам жилья с рекламой недвижимости, проведем переговоры с потенциальными покупателями, оформим документы, проведем безопасный расчет.
Жилые комплексы в Новосибирске. ЖК Сергиев Пассаж – это 25 этажный дом с подземной парковкой. Находится в экологическом месте, рядом с Бугринской рощей.
Жилой комплекс Военная 16 Военная 16 находится в 15 минутах ходьбы от станции метро Площадь Ленина. Соответствует Комфорт-классу.

cara mengobati apendisitis secara alami on this occasion I will give health information regarding the importance of the requirement of vitamin B1 (thiamine) for the body. cara mengobati apendisitis secara alami and cara mengobati apendisitis secara alami vitamin B1 (thiamine) is not a vitamin that is rare. cara mengobati apendisitis secara alami small number of levels can be found in nearly all foods, and there are plenty of foods rich in vitamin B1. cara mengobati abses otot secara alami cara mengobati abses otot secara alami however expected that the majority of people are deficient in vitamin which is very important. cara mengobati abses otot secara alami cara mengobati abses otot secara alami Why did it happen? The answer is because the vitamin is generally disappears when a food containing vitamin B1 has been processed. Manfaat Calcium Softgel Green World Manfaat Calcium Softgel Green World the vitamin B1 deficiency has been linked to the disease beriberi which can cause death and can also cause a number of symptoms related to the nervous system, including blindness Manfaat Calcium Softgel Green World Manfaat Calcium Softgel Green World.

such a great post and most informative. I truly like your post because this post very help for Do my Essay.

Video Bokep Hello very nice website!! Guy ,Excellent, Blog Video Bokep Superb ..I will bookmark your site and take the feeds also? I am glad to search out a lot of useful info here in the post, Bokep Mesum we’d like work out more strategies on this regard, thank you for sharing Video Bokep Indo ,googd your blogs Keluaran Togel

Manfaat QnC Jelly gamat Cleanliness is part of faith .With this I expect all concerned and realized the importance of maintaining cleanliness in our environment .Sekian would I say, may be useful for all of perbedaan qnc jelly gamat dan jelly gamat gold g

شركة نقل عفش بالدمام الشرق الاوسط متحصصه فى نقل عفش واثاث بالدمام ونقل العفش بالخبر كما انها توفر شركة نقل عفش بالجبيل والخبر وشركة نقل عفش بالقطيف والاحساء وجميع خدمات نقل العفش والاثاث بالمنطقة الشرقية بارخص اسعار نقل عفش بالدمام وتقدم ايضا شركة تخزين عفش بالدمام والخبر
نقل عفش بالدمام
شركة نقل اثاث بالدمام
شركة نقل اثاث بالخبر
شركة نقل اثاث بالجبيل
شركة نقل عفش بالخبر
شركة نقل عفش بالقطيف
شركة نقل اثاث بالاحساء

شركة نقل اثاث بالدمام التفاؤل شركة نقل اثاث بالخبر كما انها افضل شركة نقل اثاث بالجبيل نقل عفش واثاث بالجبيل والخبر والقطيف والدمام
شركة نقل اثاث بالدمام
شركة نقل اثاث بالجبيل
شركة نقل اثاث بالقطيف

افضل شركة تنظيف خزانات ومنازل وشقق بالمدينة المنورة شركة غسيل خزانات ومكافحة حشرات بالمدينة المنورة ونقل عفش بالمدينة المنورة مؤسسة صفوة المدينة
شركة غسيل خزانات بالمدينة المنورة

شركة نقل عفش واثاث بالدمام ابيات الشرقيه لخدمات نقل العفش والاثاث بالدمام
شركة نقل عفش بالدمام
ان اردت نقل عفش منزلك بالدمام ابيات الشرقية من اهم شركات نقل العفش بالدمام والخبر والجبيل والقطيف والاحساء

If you are interested in topic: earn online without investment logo designs - you should read about Bucksflooder first

A very nice and helpful tutorial who want to learn aliases for drush good effort and now am gonna share this blog on my website promo umroh Desember Murah di Jakarta so my students of buy an assignment uk can learn many things from your blog

[url=http://mozillafirefox2016freedownload.com]mozilla firefox 2016 download[/url]

Very good Post. Felling good by landing on this page.
Blackmart apk download
blackmart apk

Really useful Post, I appreciate your efforts and all the best. Keep it up!
RRB NTPC Result

Pages

Post new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Syntax highlight code surrounded by the {syntaxhighlighter SPEC}...{/syntaxhighlighter} tags, where SPEC is a Syntaxhighlighter options string or class="OPTIONS" [title="the title"].
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.