User login

Quick Site Recipe Shell Command Generator

Update: This has of course been quite obsoleted by drush, which Agaric is building our own scripts around (we would like to build them into Drush as much as possible), and we should eventually note on our main drush post.

I hope to turn this into a module with a form, for now it's just a PHP page that can only be edited by an admin with PHP privileges. The code that creates this page is attached.

<?php
/* NOTE: need some way of dealing with Drupal contrib modules with 2.0 versions */

$nl = "\n";  // line separator

$sudo = 0;  // 0 no sudo needed, 1 sudo needed
$drupal_version = "DRUPAL-5";
$target_directory = "test";
$contrib_modules_directory = "modules/contributed";
$contrib_themes_directory = "themes/contributed";

/* array of Drupal contributed modules
 * alphabetical except 'child' modules follow parent (esp. CCK, for instance "email" is a CCK field)
 */

$spaceshare_contrib_modules = array(actions, akismet, article, auto_nodetitle, autosave, bloginfo, bookmark_us, buddylist, casetracker, cck, email, text_regexp, captcha, comment_mover, comment_subject, contemplate, ed_classified, ed_readmore, favorite_nodes, fivestar, focus, globalredirect, gmap, gsitemap, image, imagecache, leech, links, location, logintoboggan, menu_trim, mimemail, nodefamily, nodeprofile, panels, pathauto, relativity, releasemonitor, spam, send, service_links, subscriptions, systeminfo, tagadelic, taxonomy_access, taxonomy_breadcrumb, taxonomy_theme, textimage, token, upload_preview, userlink, usernode, views, views_alpha_pager, views_bonus, votingapi, weather, webform, weight, workflow);

/* array of Drupal contributed themes */
$contrib_themes = array(aberdeen, amadou, bluebreeze, golden_hour, stylized_beauty, sinatra, sympal_theme, zen);

$contrib_modules = $spaceshare_contrib_modules;

print "<pre>";
print "This script was made with the following variables:" . $nl;
print "Drupal Version: " . $drupal_version . $nl;
print "Target Directory: " . $target_directory . $nl;
print "Path to Contrib Directory: " . $contrib_directory . $nl;
print "Contributed Modules:" . $nl;
print_r($contrib_modules);

$intro = "You should paste this output in your shell (e.g. Terminal, Putty) " . $nl .
  "starting from the directory ABOVE your target directory.";
print $intro . $nl;

$ssh = "";

// get Drupal itself
if ($sudo) $ssh .= "sudo ";
$ssh .= "cvs -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout -d " . $target_directory . " -r " . $drupal_version . " drupal";

$ssh .=$nl;

$ssh .= "cd " . $target_directory;
$ssh .= $nl;

if ($sudo) $ssh .= "sudo ";
$ssh .= "mkdir " . $contrib_modules_directory;
$ssh .= $nl;

foreach($contrib_modules as $module) {
  if ($sudo) $ssh .= "sudo ";
  $ssh .= "cvs checkout -d " . $contrib_modules_directory . "/" . $module . " -r " . $drupal_version . " contributions/modules/" . $module;
  $ssh .= $nl;
}

if ($sudo) $ssh .= "sudo ";
$ssh .= "mkdir " . $contrib_themes_directory;
$ssh .= $nl;

foreach($contrib_themes as $theme) {
  if ($sudo) $ssh .= "sudo ";
  $ssh .= "cvs checkout -d " . $contrib_themes_directory . "/" . $theme . " -r " . $drupal_version . " contributions/themes/" . $theme;
  $ssh .= $nl;
}
print $ssh;

print "</pre>";
?>

Update: This has of course been quite obsoleted by drush, which Agaric is building our own scripts around (we would like to build them into Drush as much as possible), and we should eventually note on our main drush post.

I hope to turn this into a module with a form, for now it's just a PHP page that can only be edited by an admin with PHP privileges. The code that creates this page is attached.

<?php
/* NOTE: need some way of dealing with Drupal contrib modules with 2.0 versions */

$nl = "\n"// line separator

$sudo = 0// 0 no sudo needed, 1 sudo needed
$drupal_version = "DRUPAL-5";
$target_directory = "test";
$contrib_modules_directory = "modules/contributed";
$contrib_themes_directory = "themes/contributed";

/* array of Drupal contributed modules
 * alphabetical except 'child' modules follow parent (esp. CCK, for instance "email" is a CCK field)
 */

$spaceshare_contrib_modules = array(actions, akismet, article, auto_nodetitle, autosave, bloginfo, bookmark_us, buddylist, casetracker, cck, email, text_regexp, captcha, comment_mover, comment_subject, contemplate, ed_classified, ed_readmore, favorite_nodes, fivestar, focus, globalredirect, gmap, gsitemap, image, imagecache, leech, links, location, logintoboggan, menu_trim, mimemail, nodefamily, nodeprofile, panels, pathauto, relativity, releasemonitor, spam, send, service_links, subscriptions, systeminfo, tagadelic, taxonomy_access, taxonomy_breadcrumb, taxonomy_theme, textimage, token, upload_preview, userlink, usernode, views, views_alpha_pager, views_bonus, votingapi, weather, webform, weight, workflow);

/* array of Drupal contributed themes */
$contrib_themes = array(aberdeen, amadou, bluebreeze, golden_hour, stylized_beauty, sinatra, sympal_theme, zen);

$contrib_modules = $spaceshare_contrib_modules;

print

"<pre>";
print
"This script was made with the following variables:" . $nl;
print
"Drupal Version: " . $drupal_version . $nl;
print
"Target Directory: " . $target_directory . $nl;
print
"Path to Contrib Directory: " . $contrib_directory . $nl;
print
"Contributed Modules:" . $nl;
print_r($contrib_modules);

$intro = "You should paste this output in your shell (e.g. Terminal, Putty) " . $nl .
 
"starting from the directory ABOVE your target directory.";
print
$intro . $nl;

$ssh = "";

// get Drupal itself
if ($sudo) $ssh .= "sudo ";
$ssh .= "cvs -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout -d " . $target_directory . " -r " . $drupal_version . " drupal";

$ssh .=$nl;

$ssh .= "cd " . $target_directory;
$ssh .= $nl;

if (

$sudo) $ssh .= "sudo ";
$ssh .= "mkdir " . $contrib_modules_directory;
$ssh .= $nl;

foreach(

$contrib_modules as $module) {
  if (
$sudo) $ssh .= "sudo ";
 
$ssh .= "cvs checkout -d " . $contrib_modules_directory . "/" . $module . " -r " . $drupal_version . " contributions/modules/" . $module;
 
$ssh .= $nl;
}

if (

$sudo) $ssh .= "sudo ";
$ssh .= "mkdir " . $contrib_themes_directory;
$ssh .= $nl;

foreach(

$contrib_themes as $theme) {
  if (
$sudo) $ssh .= "sudo ";
 
$ssh .= "cvs checkout -d " . $contrib_themes_directory . "/" . $theme . " -r " . $drupal_version . " contributions/themes/" . $theme;
 
$ssh .= $nl;
}
print
$ssh;

print

"</pre>";
?>

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.