Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
provision
Commits
a3f79563
Commit
a3f79563
authored
Mar 31, 2011
by
mig5
Browse files
merge and update versions to prepare for 6.x-1.0-rc3
parents
82a09cc9
6d132cbd
Changes
12
Hide whitespace changes
Inline
Side-by-side
aegir.make
View file @
a3f79563
...
...
@@ -6,4 +6,4 @@ projects[drupal][type] = "core"
projects[hostmaster][type]
=
"profile"
projects[hostmaster][download][type]
=
"git"
projects[hostmaster][download][url] = "http
:
//git.drupal.org/project/hostmaster.git"
projects[hostmaster][download][
branch
]
=
"6.x-1.
x
"
projects[hostmaster][download][
tag
]
=
"6.x-1.
0-rc3
"
install.hostmaster.inc
View file @
a3f79563
...
...
@@ -15,8 +15,9 @@ function drush_provision_hostmaster_install_validate($site = NULL) {
drush_set_default
(
'script_user'
,
provision_current_user
());
drush_set_default
(
'web_group'
,
_provision_default_web_group
());
drush_set_default
(
'http_service_type'
,
'apache'
);
drush_set_default
(
'drush_make_version'
,
'6.x-2.
1
'
);
drush_set_default
(
'drush_make_version'
,
'6.x-2.
2
'
);
drush_set_default
(
'aegir_db_user'
,
'root'
);
drush_set_default
(
'client_name'
,
'admin'
);
$aegir_db_user
=
drush_get_option
(
'aegir_db_user'
);
drush_set_default
(
'makefile'
,
$aegir_root
.
'/.drush/provision/aegir.make'
);
...
...
@@ -82,7 +83,7 @@ The following settings will be used:
Aegir version: !version
Aegir platform path: !root
Aegir makefile: !makefile
Client
email: !email
Admin
email: !email
'
,
array
(
'!site'
=>
$site
,
'!fqdn'
=>
drush_get_option
(
'aegir_host'
),
'!home'
=>
drush_get_option
(
'aegir_root'
),
...
...
@@ -186,10 +187,10 @@ function drush_provision_hostmaster_install($site = NULL) {
'platform'
=>
$platform_name
,
'db_server'
=>
$dbserver
,
'uri'
=>
$site
,
'client_
email
'
=>
drush_get_option
(
'client_
email
'
),
'client_
name
'
=>
drush_get_option
(
'client_
name
'
),
'profile'
=>
'hostmaster'
,
));
$data
=
provision_backend_invoke
(
$site_name
,
'provision-install'
);
$data
=
provision_backend_invoke
(
$site_name
,
'provision-install'
,
array
(),
array
(
'client_email'
=>
drush_get_option
(
'client_email'
))
);
provision_backend_invoke
(
$site_name
,
'provision-verify'
);
// exit if an error has occured.
...
...
install.sh.txt
View file @
a3f79563
...
...
@@ -28,8 +28,8 @@
########################################################################
# guess the aegir version based on the info file
AEGIR_VERSION="
0.4
-rc
1
"
DRUSH_VERSION=
6
.x-
3.3
AEGIR_VERSION="
6.x-1.0
-rc
3
"
DRUSH_VERSION=
7
.x-
4.4
########################################################################
# functions
...
...
platform/backup.provision.inc
View file @
a3f79563
...
...
@@ -30,7 +30,7 @@ function drush_provision_drupal_provision_backup_validate($backup_file = NULL) {
drush_set_error
(
'PROVISION_BACKUP_ALREADY_EXISTS'
,
dt
(
'Back up file @path already exists.'
,
array
(
'@path'
=>
$backup_file
)));
}
else
{
drush_log
(
dt
(
'Backing site up to @path.'
,
array
(
'@path'
=>
$backup_file
))
,
'ok'
);
drush_log
(
dt
(
'Backing site up to @path.'
,
array
(
'@path'
=>
$backup_file
)));
drush_set_option
(
'backup_file'
,
$backup_file
);
}
}
...
...
@@ -110,6 +110,10 @@ function drush_provision_drupal_provision_backup() {
}
}
function
drush_provision_drupal_post_provision_backup
()
{
drush_log
(
dt
(
'Backed up site up to @path.'
,
array
(
'@path'
=>
drush_get_option
(
'backup_file'
))),
'success'
);
}
/**
* Remove the backup file if something went wrong
*/
...
...
platform/drupal/install_5.inc
View file @
a3f79563
...
...
@@ -7,7 +7,6 @@
$GLOBALS
[
'url'
]
=
d
()
->
uri
;
$GLOBALS
[
'profile'
]
=
d
()
->
profile
;
$GLOBALS
[
'install_locale'
]
=
d
()
->
language
;
$GLOBALS
[
'client_email'
]
=
d
()
->
client_email
;
$GLOBALS
[
'base_url'
]
=
provision_get_base_url
();
...
...
@@ -60,11 +59,10 @@ function install_create_admin_user($client_email = NULL) {
return
user_save
(
$account
,
$edit
);
}
function
install_send_welcome_mail
(
$url
,
$account
,
$profile
,
$language
,
$client_email
)
{
function
install_send_welcome_mail
(
$url
,
$account
,
$profile
,
$language
,
$client_email
,
$onetime
)
{
global
$base_url
;
// Mail one time login URL and instructions.
$from
=
variable_get
(
'site_mail'
,
ini_get
(
'sendmail_from'
));
$onetime
=
user_pass_reset_url
(
$account
);
$variables
=
array
(
'!username'
=>
$account
->
name
,
'!site'
=>
variable_get
(
'site_name'
,
'Drupal'
),
'!login_url'
=>
$onetime
,
...
...
@@ -72,9 +70,6 @@ function install_send_welcome_mail($url, $account, $profile, $language, $client_
'!date'
=>
format_date
(
time
()),
'!login_uri'
=>
url
(
'user'
,
NULL
,
NULL
,
TRUE
),
'!edit_uri'
=>
url
(
'user/'
.
$account
->
uid
.
'/edit'
,
NULL
,
NULL
,
TRUE
));
// Store the one time login link in an option so the front end can direct the user to their new site.
drush_set_option
(
'login_link'
,
$onetime
);
// allow the profile to override welcome email text
if
(
file_exists
(
"./profiles/
$profile
/provision_welcome_mail.inc"
))
{
require_once
"./profiles/
$profile
/provision_welcome_mail.inc"
;
...
...
@@ -110,7 +105,6 @@ function install_send_welcome_mail($url, $account, $profile, $language, $client_
else
{
drush_log
(
t
(
'Could not send welcome mail to @client'
,
array
(
'@client'
=>
$client_email
)));
}
drush_log
(
t
(
'Login url: !onetime'
,
array
(
'!onetime'
=>
$onetime
)),
'message'
);
}
function
install_main
()
{
...
...
@@ -118,7 +112,8 @@ function install_main() {
drush_bootstrap
(
DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION
);
// This must go after drupal_bootstrap(), which unsets globals!
global
$profile
,
$install_locale
,
$client_email
;
global
$profile
,
$install_locale
;
require_once
'./modules/system/system.install'
;
require_once
'./includes/file.inc'
;
...
...
@@ -193,9 +188,15 @@ function install_main() {
variable_set
(
'install_profile'
,
$profile
);
$account
=
install_create_admin_user
(
$url
,
$client_email
);
$client_email
=
drush_get_option
(
'client_email'
);
$account
=
install_create_admin_user
(
$client_email
);
$onetime
=
user_pass_reset_url
(
$account
);
// Store the one time login link in an option so the front end can direct the user to their new site.
drush_set_option
(
'login_link'
,
$onetime
);
drush_log
(
t
(
'Login url: !onetime'
,
array
(
'!onetime'
=>
$onetime
)),
'message'
);
if
(
$client_email
)
{
install_send_welcome_mail
(
$url
,
$account
,
$profile
,
$install_locale
,
$client_email
);
install_send_welcome_mail
(
$url
,
$account
,
$profile
,
$install_locale
,
$client_email
,
$onetime
);
}
}
install_main
();
platform/drupal/install_6.inc
View file @
a3f79563
...
...
@@ -7,7 +7,6 @@
$GLOBALS
[
'url'
]
=
d
()
->
uri
;
$GLOBALS
[
'profile'
]
=
d
()
->
profile
;
$GLOBALS
[
'install_locale'
]
=
d
()
->
language
;
$GLOBALS
[
'client_email'
]
=
d
()
->
client_email
;
$GLOBALS
[
'base_url'
]
=
provision_get_base_url
();
...
...
@@ -45,7 +44,6 @@ function install_verify_settings() {
}
function
install_create_admin_user
(
$client_email
=
NULL
)
{
global
$client_email
;
if
(
!
$client_email
)
{
$client_email
=
'webmaster@localhost'
;
}
...
...
@@ -64,11 +62,11 @@ function install_create_admin_user($client_email = NULL) {
return
$account
;
}
function
install_send_welcome_mail
(
$url
,
$account
,
$profile
,
$language
,
$client_email
)
{
function
install_send_welcome_mail
(
$url
,
$account
,
$profile
,
$language
,
$client_email
,
$onetime
)
{
global
$base_url
;
// Mail one time login URL and instructions.
$from
=
variable_get
(
'site_mail'
,
ini_get
(
'sendmail_from'
));
$onetime
=
user_pass_reset_url
(
$account
);
$mail_params
[
'variables'
]
=
array
(
'!username'
=>
$account
->
name
,
'!site'
=>
variable_get
(
'site_name'
,
'Drupal'
),
'!login_url'
=>
$onetime
,
'!uri'
=>
$base_url
,
'!uri_brief'
=>
preg_replace
(
'!^https?://!'
,
''
,
$base_url
),
'!mailto'
=>
$account
->
mail
,
...
...
@@ -77,16 +75,12 @@ function install_send_welcome_mail($url, $account, $profile, $language, $client_
$mail_success
=
drupal_mail
(
'install'
,
'welcome-admin'
,
$client_email
,
user_preferred_language
(
$account
),
$mail_params
,
$from
,
TRUE
);
// Store the one time login link in an option so the front end can direct the user to their new site.
drush_set_option
(
'login_link'
,
$onetime
);
if
(
$mail_success
)
{
drush_log
(
t
(
'Sent welcome mail to @client'
,
array
(
'@client'
=>
$client_email
)),
'message'
);
}
else
{
drush_log
(
t
(
'Could not send welcome mail to @client'
,
array
(
'@client'
=>
$client_email
)));
}
drush_log
(
t
(
'Login url: !onetime'
,
array
(
'!onetime'
=>
$onetime
)),
'message'
);
}
function
install_mail
(
$key
,
&
$message
,
$params
)
{
...
...
@@ -129,7 +123,7 @@ function install_main() {
drush_bootstrap
(
DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION
);
// This must go after drupal_bootstrap(), which unsets globals!
global
$profile
,
$install_locale
,
$client_email
,
$conf
,
$url
;
global
$profile
,
$install_locale
,
$conf
,
$url
;
require_once
'./modules/system/system.install'
;
require_once
'./includes/file.inc'
;
...
...
@@ -353,9 +347,15 @@ function install_main() {
cache_clear_all
();
variable_set
(
'install_profile'
,
$profile
);
$account
=
install_create_admin_user
(
$url
,
$client_email
);
$client_email
=
drush_get_option
(
'client_email'
);
$account
=
install_create_admin_user
(
$client_email
);
$onetime
=
user_pass_reset_url
(
$account
);
// Store the one time login link in an option so the front end can direct the user to their new site.
drush_set_option
(
'login_link'
,
$onetime
);
drush_log
(
t
(
'Login url: !onetime'
,
array
(
'!onetime'
=>
$onetime
)),
'message'
);
if
(
$client_email
)
{
install_send_welcome_mail
(
$url
,
$account
,
$profile
,
$install_locale
,
$client_email
);
install_send_welcome_mail
(
$url
,
$account
,
$profile
,
$install_locale
,
$client_email
,
$onetime
);
}
variable_set
(
'install_task'
,
'done'
);
}
...
...
platform/drupal/install_7.inc
View file @
a3f79563
...
...
@@ -7,29 +7,14 @@
$GLOBALS
[
'url'
]
=
d
()
->
uri
;
$GLOBALS
[
'profile'
]
=
d
()
->
profile
;
$GLOBALS
[
'install_locale'
]
=
d
()
->
language
;
$GLOBALS
[
'client_email'
]
=
d
()
->
client_email
;
$GLOBALS
[
'base_url'
]
=
provision_get_base_url
();
define
(
'MAINTENANCE_MODE'
,
'install'
);
function
install_send_welcome_mail
(
$url
,
$
profile
,
$language
,
$client_email
)
{
function
install_send_welcome_mail
(
$url
,
$
account
,
$language
,
$client_email
,
$onetime
)
{
if
(
$client_email
)
{
// create the admin account
$account
=
user_load
(
1
);
$edit
[
'name'
]
=
'admin'
;
$edit
[
'pass'
]
=
user_password
();
$edit
[
'mail'
]
=
$client_email
;
$edit
[
'status'
]
=
1
;
// temporarily disable drupal's default mail notification
$prev
=
variable_get
(
'user_mail_status_activated_notify'
,
TRUE
);
variable_set
(
'user_mail_status_activated_notify'
,
FALSE
);
$account
=
user_save
(
$account
,
$edit
);
variable_set
(
'user_mail_status_activated_notify'
,
$prev
);
// Mail one time login URL and instructions.
$from
=
variable_get
(
'site_mail'
,
ini_get
(
'sendmail_from'
));
$onetime
=
user_pass_reset_url
(
$account
);
$mail_params
[
'variables'
]
=
array
(
'!username'
=>
$account
->
name
,
'!site'
=>
variable_get
(
'site_name'
,
'Drupal'
),
'!login_url'
=>
$onetime
,
'!uri'
=>
$base_url
,
'!uri_brief'
=>
preg_replace
(
'!^https?://!'
,
''
,
$base_url
),
'!mailto'
=>
$account
->
mail
,
...
...
@@ -38,17 +23,12 @@ function install_send_welcome_mail($url, $profile, $language, $client_email) {
$mail_success
=
drupal_mail
(
'install'
,
'welcome-admin'
,
$account
->
mail
,
user_preferred_language
(
$account
),
$mail_params
,
$from
,
TRUE
);
// Store the one time login link in an option so the front end can direct the user to their new site.
drush_set_option
(
'login_link'
,
$onetime
);
if
(
$mail_success
)
{
drush_log
(
t
(
'Sent welcome mail to @client'
,
array
(
'@client'
=>
$client_email
)),
'message'
);
}
else
{
drush_log
(
t
(
'Could not send welcome mail to @client'
,
array
(
'@client'
=>
$client_email
)));
}
drush_log
(
t
(
'Login url: !onetime'
,
array
(
'!onetime'
=>
$onetime
)),
'message'
);
}
}
...
...
@@ -90,7 +70,9 @@ function install_mail($key, &$message, $params) {
function
install_main
()
{
global
$profile
,
$install_locale
,
$client_email
,
$conf
,
$url
,
$base_url
;
global
$profile
,
$install_locale
,
$conf
,
$url
,
$base_url
;
$client_email
=
drush_get_option
(
'client_email'
);
require_once
DRUPAL_ROOT
.
'/includes/install.core.inc'
;
...
...
@@ -147,8 +129,26 @@ function install_main() {
}
_provision_drupal_create_directories
();
// create the admin account
$account
=
user_load
(
1
);
$edit
[
'name'
]
=
'admin'
;
$edit
[
'pass'
]
=
$account_pass
;
$edit
[
'mail'
]
=
$client_email
;
$edit
[
'status'
]
=
1
;
// temporarily disable drupal's default mail notification
$prev
=
variable_get
(
'user_mail_status_activated_notify'
,
TRUE
);
variable_set
(
'user_mail_status_activated_notify'
,
FALSE
);
$account
=
user_save
(
$account
,
$edit
);
variable_set
(
'user_mail_status_activated_notify'
,
$prev
);
$onetime
=
user_pass_reset_url
(
$account
);
// Store the one time login link in an option so the front end can direct the user to their new site.
drush_set_option
(
'login_link'
,
$onetime
);
drush_log
(
t
(
'Login url: !onetime'
,
array
(
'!onetime'
=>
$onetime
)),
'message'
);
if
(
$client_email
)
{
install_send_welcome_mail
(
$url
,
$
profile
,
$install_locale
,
$client_email
);
install_send_welcome_mail
(
$url
,
$
account
,
$install_locale
,
$client_email
,
$onetime
);
}
}
install_main
();
...
...
platform/install.provision.inc
View file @
a3f79563
...
...
@@ -55,7 +55,7 @@ function drush_provision_drupal_provision_install() {
drush_bootstrap
(
DRUSH_BOOTSTRAP_DRUPAL_SITE
);
// call a backend task to do the actual installation.
$result
=
provision_backend_invoke
(
d
()
->
name
,
"provision-install-backend"
);
$result
=
provision_backend_invoke
(
d
()
->
name
,
"provision-install-backend"
,
array
(),
array
(
'client_email'
=>
drush_get_option
(
'client_email'
))
);
// pass the login link back to the front end.
drush_set_option
(
'login_link'
,
$result
[
'context'
][
'login_link'
]);
...
...
provision.config.inc
View file @
a3f79563
...
...
@@ -293,6 +293,8 @@ class provisionConfig_drushrc_server extends provisionConfig_drushrc {
class
provisionConfig_drushrc_platform
extends
provisionConfig_drushrc
{
protected
$context_name
=
'drupal'
;
public
$description
=
'Platform Drush configuration file'
;
// platforms contain no confidential information
protected
$mode
=
0444
;
function
filename
()
{
return
$this
->
root
.
'/drushrc.php'
;
...
...
provision.context.site.inc
View file @
a3f79563
...
...
@@ -16,7 +16,7 @@ class provisionContext_site extends provisionContext {
'--language'
=>
'site: site language; default en'
,
'--aliases'
=>
'site: comma-separated URIs'
,
'--redirection'
=>
'site: boolean for whether --aliases should redirect; default false'
,
'--client_
email
'
=>
'site:
e
ma
il for the site owner
'
,
'--client_
name
'
=>
'site: ma
chine name of the client that owns this site
'
,
'--profile'
=>
'site: Drupal profile to use; default default'
,
);
}
...
...
@@ -32,7 +32,7 @@ class provisionContext_site extends provisionContext {
$this
->
setProperty
(
'site_enabled'
,
true
);
$this
->
setProperty
(
'language'
,
'en'
);
$this
->
setProperty
(
'client_
email
'
);
$this
->
setProperty
(
'client_
name
'
);
$this
->
setProperty
(
'aliases'
,
array
(),
TRUE
);
$this
->
setProperty
(
'redirection'
,
FALSE
);
...
...
provision.inc
View file @
a3f79563
...
...
@@ -253,6 +253,15 @@ function provision_posix_groupname($group) {
return
$group
;
}
/**
* Generate a random alphanumeric password.
*
* This is a copy of Drupal core's user_password() function. We keep it
* here in case we need this and don't have a bootstrapped Drupal
* around.
*
* @see user_password()
*/
function
provision_password
(
$length
=
10
)
{
// This variable contains the list of allowable characters for the
// password. Note that the number 0 and the letter 'O' have been
...
...
upgrade.sh.txt
View file @
a3f79563
...
...
@@ -11,14 +11,14 @@
########################################################################
# basic variables, change before running
AEGIR_VERSION="6.x-1.0-rc
2
"
AEGIR_VERSION="6.x-1.0-rc
3
"
AEGIR_DOMAIN=aegir.example.com
AEGIR_HOME="$HOME"
DRUPAL_DIR=$AEGIR_HOME/hostmaster-$AEGIR_VERSION
DRUSH_VERSION=
6
.x-
3.3
DRUSH_MAKE_VERSION=6.x-2.
1
OLD_DRUPAL_DIR=$AEGIR_HOME/hostmaster-
0.4
-rc
1
DRUSH_VERSION=
7
.x-
4.4
DRUSH_MAKE_VERSION=6.x-2.
2
OLD_DRUPAL_DIR=$AEGIR_HOME/hostmaster-
6.x-1.0
-rc
2
DRUSH_DIR=$AEGIR_HOME/drush
DRUSH="php $DRUSH_DIR/drush.php"
BACKUP_DIR=$AEGIR_HOME/pre-upgrade-`date '+%F-%H%M'`
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment