Skip to main content
deleted 183 characters in body
Source Link
latvian
  • 807
  • 12
  • 25

So, i wasn't able to figure out how to bootstrap the new Drupal instance in the installation directory as i would like, but what worked was creating a separate drush script only for configuring the instance and call it from the installation script as following:

drush_shell_exec('drush ../config/drush-scripts/configure-site.php --debug --build-src=the-make-file-installing-the-site.make');

And the configuration script:

#!/usr/bin/env drush
<?php    

// check if we can bootstrap
$self = drush_sitealias_get_record('@self');
if (empty($self)) {
    drush_die("I can't bootstrap from the current location.", 0);
}

drush_print("Time to prepare the working environment.");

 //let's jumpgo to our site directory before we dothe anythinginstall elsedir
drush_op('chdir', $self['root']);


# Enable modules
##########################################################
$build_file_parsed = drupal_parse_info_file($make_file);
//print_r($build_file_parsed);
$modules_to_enable = array_diff($build_file_parsed['projects'],array('drupal'));
//print_r($modules_to_enable);
$modules_enabled = drush_invoke_process("@self", "pm-enable", $modules_to_enable);
drush_print('Modules ' . (($modules_enabled) ? 'WAS' : 'WAS NOT' ). '  Enabled');

# Pre configure settings
##########################################################
# disable user pictures
variable_set('user_pictures',0);

# allow only admins to register users
variable_set('user_register',0);

# set site slogan
variable_set('site_slogan',$siteSlogan);

# Configure JQuery update
variable_set('jquery_update_compression_type', "min");
variable_set('jquery_update_jquery_cdn',"google");
variable_set('jquery_update_jquery_version',"1.7");

I hope one day it will become apparent why i wasn't able to do all - download, install and configure in one drush script or if you know, please, share

So, i wasn't able to figure out how to bootstrap the new Drupal instance in the installation directory as i would like, but what worked was creating a separate drush script only for configuring the instance and call it from the installation script as following:

drush_shell_exec('drush ../config/drush-scripts/configure-site.php --debug --build-src=the-make-file-installing-the-site.make');

And the configuration script:

#!/usr/bin/env drush
<?php    

// check if we can bootstrap
$self = drush_sitealias_get_record('@self');
if (empty($self)) {
    drush_die("I can't bootstrap from the current location.", 0);
}

drush_print("Time to prepare the working environment.");

 //let's jump to our site directory before we do anything else
drush_op('chdir', $self['root']);


# Enable modules
##########################################################
$build_file_parsed = drupal_parse_info_file($make_file);
//print_r($build_file_parsed);
$modules_to_enable = array_diff($build_file_parsed['projects'],array('drupal'));
//print_r($modules_to_enable);
$modules_enabled = drush_invoke_process("@self", "pm-enable", $modules_to_enable);
drush_print('Modules ' . (($modules_enabled) ? 'WAS' : 'WAS NOT' ). '  Enabled');

# Pre configure settings
##########################################################
# disable user pictures
variable_set('user_pictures',0);

# allow only admins to register users
variable_set('user_register',0);

# set site slogan
variable_set('site_slogan',$siteSlogan);

# Configure JQuery update
variable_set('jquery_update_compression_type', "min");
variable_set('jquery_update_jquery_cdn',"google");
variable_set('jquery_update_jquery_version',"1.7");

I hope one day it will become apparent why i wasn't able to do all - download, install and configure in one drush script or if you know, please, share

i wasn't able to figure out how to bootstrap the new Drupal instance in the installation directory as i would like, but what worked was creating a separate drush script only for configuring the instance and call it from the installation script as following:

drush_shell_exec('drush ../config/drush-scripts/configure-site.php --debug --build-src=the-make-file-installing-the-site.make');

And the configuration script:

#!/usr/bin/env drush
<?php    

// check if we can bootstrap
$self = drush_sitealias_get_record('@self');
if (empty($self)) {
    drush_die("I can't bootstrap from the current location.", 0);
}

//go to the install dir
drush_op('chdir', $self['root']);


# Enable modules
##########################################################
$build_file_parsed = drupal_parse_info_file($make_file);
$modules_to_enable = array_diff($build_file_parsed['projects'],array('drupal'));
$modules_enabled = drush_invoke_process("@self", "pm-enable", $modules_to_enable);
drush_print('Modules ' . (($modules_enabled) ? 'WAS' : 'WAS NOT' ). '  Enabled');

# Pre configure settings
##########################################################
# disable user pictures
variable_set('user_pictures',0);

# allow only admins to register users
variable_set('user_register',0);

# set site slogan
variable_set('site_slogan',$siteSlogan);

# Configure JQuery update
variable_set('jquery_update_compression_type', "min");
variable_set('jquery_update_jquery_cdn',"google");
variable_set('jquery_update_jquery_version',"1.7");

I hope one day it will become apparent why i wasn't able to do all - download, install and configure in one drush script or if you know, please, share

Source Link
latvian
  • 807
  • 12
  • 25

So, i wasn't able to figure out how to bootstrap the new Drupal instance in the installation directory as i would like, but what worked was creating a separate drush script only for configuring the instance and call it from the installation script as following:

drush_shell_exec('drush ../config/drush-scripts/configure-site.php --debug --build-src=the-make-file-installing-the-site.make');

And the configuration script:

#!/usr/bin/env drush
<?php    

// check if we can bootstrap
$self = drush_sitealias_get_record('@self');
if (empty($self)) {
    drush_die("I can't bootstrap from the current location.", 0);
}

drush_print("Time to prepare the working environment.");

 //let's jump to our site directory before we do anything else
drush_op('chdir', $self['root']);


# Enable modules
##########################################################
$build_file_parsed = drupal_parse_info_file($make_file);
//print_r($build_file_parsed);
$modules_to_enable = array_diff($build_file_parsed['projects'],array('drupal'));
//print_r($modules_to_enable);
$modules_enabled = drush_invoke_process("@self", "pm-enable", $modules_to_enable);
drush_print('Modules ' . (($modules_enabled) ? 'WAS' : 'WAS NOT' ). '  Enabled');

# Pre configure settings
##########################################################
# disable user pictures
variable_set('user_pictures',0);

# allow only admins to register users
variable_set('user_register',0);

# set site slogan
variable_set('site_slogan',$siteSlogan);

# Configure JQuery update
variable_set('jquery_update_compression_type', "min");
variable_set('jquery_update_jquery_cdn',"google");
variable_set('jquery_update_jquery_version',"1.7");

I hope one day it will become apparent why i wasn't able to do all - download, install and configure in one drush script or if you know, please, share