Mura Automation - Step 1: Get started with 2 words

I've been building sites with Mura CMS for about 4 years now, and can't say enough about how much I enjoy it..... that is, once I get going. True, there is an installer, but since I like to be particular about my development setup, it doesn't give me a whole lot of options when I'm just looking to start a new project.

The process of downloading the latest, greatest version of Mura, unzipping it to the location I want it, and renaming the folder, just seems trivial and ... well... annoying. Call me lazy, but I just don't like having to do it over and over again. Automation is something I hear buzzing around from many developers and designers using Mura CMS alike, so I've been motivated to get that process into action!

Enter Step 1

If you're a Mac or Linux user, then you're in luck. If not, ....well ping me, and we'll see if we can get the same outcome using Windows. If you're used to using Terminal (I prefer Iterm 2), you can easily create a shortcut to download the latest version of Mura into a directory of you're liking, and have it completely renamed to the project you're currently working on with two words. That's right, 2 words. Well, unless of course, your project name has multiple words, but lets assume that's not the case.

Prep

Prerequisite - You must have Git installed to pull the way we are below, although you could change it to pull the zip file, and then unzip it.

Open up terminal or Iterm, and first thing we need to do is modify your .bash_profile file. Enter the code below to do so.

nano ~/.bash_profile

Alternatively, you can simply fire up your text editor of choice, and open up ~/.bash_profile to get the same results.

Next, there are two things we'll do: 1) create an alias to our development folder, and 2) create a function to do our work.

Create an Alias

alias sites='cd /Users/YOURUSER/Sites'

 

Create a Function

# Start a new Mura site
function mura() {
        sites;
        git clone https://github.com/blueriver/MuraCMS.git;
        mv MuraCMS/ $1;
}

So, the alias just creates a simple shortcut for us, so that in terminal we can simply type "sites" to get to our Sites folder really fast. The second, is our function. First line tells us to go to the sites folder, then go clone the latest/greatest copy of Mura. Finally, we want to rename that folder to $1 which is whatever we pass into the function (see next section).

Save the .bash_profile.

Usage

Now, when we want to start a new project, we simply fire up Terminal, and type the following:

mura MYPROJECTNAME

That's it! Enjoy!

Comments

Audilio

Bravo!I think it is fantastic and inispring to see these brilliant young minds get together to share, exchange and brainstorm.We need to find fair and sustainable ways to move forward not just for our own survival, but especially for our next generation.Btw, have you guys considered contacting Ted talks? (www.TED.com). It would be great to see your presenters/speakers or even a delegate of your Jam session representing you on TED thereby spreading the word even further!Wishing you all a successful and rewarding weekend, I would have definitely loved to attend!(but alas, it's a little to far for me )Cheers,V

March 11, 2012, 6:48 AM
Reply
Post a Comment
  1. Leave this field empty

Required Field