User login

Updating your Rakefile and syncing content

As when working on any Agaric project that may not have had maintenance done on it in a while, update the Rakefile to be in line with current processes.

First, make sure your Vlad checkout is up-to-date. Go to it cd ~/vlad (in my case, i symlinked Vlad's true location to my home folder so he can find it. On my system Vlad's true location is /usr/local/lib/site_ruby/1.8/i686-linux/vlad/) and git pull.

cd ~/code/projectname
mv Rakefile RakefileOLD
cp /home/ben/vlad/Rakefile Rakefile
diff -up

Look for any lines with a minus on them to see if they have project-specific information (like the project name). These will have to be added back, probably manually. The only information you are likely to need is the application name, which you can put it in where it is blank in the new Rakefile (put the name in where set :application, ""), and the production db_pass, which you can add the whole line under the db_name line. For instance:

  set :db_name, application
  set :db_pass, "H5GrlQOB"

Now rake -T should include some local, non-Vlad tasks at the top, such as:

rake db:sync_from_test

We'll use that one in a moment. Agaric sets things up so local sites synchronize from the test site. This saves repeated hits to the database of the live site. When we're the first person to do this in a while and we need our database current, however, we first sync from the live site to the test site.

rake test vlad:db:sync_from_production

Now, we can bring that fresh-from-live database home:

rake local db:sync_from_test

Note the 'local' - you need to give rake some context, and the Rakefile should define the db_name variable in the local context (to be the same as the application name, which is why you don't have to edit it).

Moving databases around can take a little while. If you want to make sure a hanging command is in fact doing something, open another terminal window on your local computer and type top. If there is not mysqld process, something failed and you can ctrl+c the command, and try again.

You may need to set up settings.php locally to have your local database credentials (which is always using the project name as the database, username, and password in my set-up).

Now your local site is working, your Rakefile is up to date for all your deployment and development needs, and you are entering a state of site-building ultra-efficiency...

Searched words: 
update Rakefile

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.