Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
provision
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
provision
Commits
1b2b5f51
Commit
1b2b5f51
authored
Mar 28, 2008
by
Adrian Rossouw
Committed by
adrian
Mar 28, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add dependency on cvs_deploy module to properly retreive the version for all packages
parent
65aaab5b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
17 deletions
+56
-17
db_server/provision_mysql.module
db_server/provision_mysql.module
+4
-0
platform/provision_drupal.module
platform/provision_drupal.module
+16
-3
provision.info
provision.info
+1
-1
provision.module
provision.module
+35
-13
No files found.
db_server/provision_mysql.module
View file @
1b2b5f51
...
...
@@ -195,3 +195,7 @@ function provision_mysql_provision_verify() {
}
provision_set_active_db
();
}
function
provision_mysql_restore
(
$url
,
$backup_file
,
&
$data
)
{
}
platform/provision_drupal.module
View file @
1b2b5f51
...
...
@@ -232,7 +232,6 @@ function _provision_drupal_switch_active_site($url = null) {
# This is just for backup, to be able to restore to the old DRUSH system.
extract
(
$backups
,
EXTR_OVERWRITE
);
provision_set_active_db
();
}
}
...
...
@@ -327,7 +326,21 @@ function provision_drupal_provision_verify($url, &$data) {
}
$profiles
=
file_scan_directory
(
'./profiles'
,
'\.profile$'
,
array
(
'.'
,
'..'
,
'CVS'
,
'.svn'
),
0
,
TRUE
,
'name'
,
0
);
$data
[
'profiles'
]
=
$profiles
;
$data
[
'modules'
]
=
module_rebuild_cache
();
$modules
=
module_rebuild_cache
();
foreach
(
$modules
as
$modulename
=>
$file
)
{
$project
=
array
();
$project
[
'filename'
]
=
$file
->
filename
;
$project
[
'name'
]
=
$file
->
name
;
if
(
empty
(
$project
[
'project'
]))
{
$project
[
'project'
]
=
cvs_deploy_get_project_name
(
$project
);
}
_cvs_deploy_version_alter
(
$file
->
info
[
'version'
],
$project
);
$name
=
(
$project
[
'project'
])
?
$project
[
'project'
]
:
$modulename
;
$modules
[
$name
]
=
$file
;
}
$data
[
'modules'
]
=
$modules
;
}
function
provision_drupal_restore
(
$url
,
$backup_file
,
&
$data
)
{
provision_shell_exec
(
"tar -zxf %s -C sites/%s"
,
$backup_file
,
$url
);
# checkout over old sites dir.
}
provision.info
View file @
1b2b5f51
name
=
Provision
description
=
Allows
for
the
automated
provisioning
of
hosted
Drupal
sites
,
via
the
command
line
package
=
Provision
dependencies
=
drush
provision_drupal
provision_mysql
provision_apache
\ No newline at end of file
dependencies
=
drush
provision_drupal
provision_mysql
provision_apache
cvs_deploy
provision.module
View file @
1b2b5f51
...
...
@@ -28,7 +28,7 @@
* Uses hook_provision_pre_upgrade(), hook_provision_upgrade() and hook_provision_post_upgrade() hooks,
* and allows clean roll back if any errors occur. Will include stringent checking of module versions,
* and allow unit tests to be run.
* r
ollback
- Revert to a previous backup of the site.
* r
estore
- Revert to a previous backup of the site.
* rename - Change the url of a site. This requires moving of files, and numerous other issues.
* delete - Generates a back up of the site, and then removes all references to it.
*/
...
...
@@ -272,12 +272,20 @@ function provision_drush_command() {
'arguments'
=>
array
(
'domain.com'
=>
t
(
'The domain of the site to disable (only if disabled).'
)),
'description'
=>
'Disable a site.'
);
$items
[
'provision verify'
]
=
array
(
'callback'
=>
'_provision_verify'
,
# 'arguments' => array('domain.com' => t('The domain of the site to disable (only if disabled).')),
'description'
=>
'Verify that the provisioning framework is correctly installed.'
);
$items
[
'provision restore'
]
=
array
(
'callback'
=>
'_provision_restore'
,
'description'
=>
'Restore the site to a previous backup. This will also generate a backup of the site as it was.'
,
'arguments'
=>
array
(
'domain.com'
=>
t
(
'The domain of the site to be restored'
),
'site_backup.tar.gz'
=>
t
(
'The backup to restore the site to.'
))
);
/*
// Not implemented yet.
$items['provision delete'] = array(
...
...
@@ -285,11 +293,6 @@ function provision_drush_command() {
'description' => 'Delete a site.'
);
$items['provision rollback'] = array(
'callback' => '_provision_rollback',
'description' => 'Roll back the site to a previous backup.'
);
$items['provision deploy'] = array(
'callback' => '_provision_deploy',
'description' => 'Deploy a backup made on another provisioning platform on this one.'
...
...
@@ -473,6 +476,19 @@ function _provision_backup($url) {
provision_output
(
$url
,
$data
);
}
$data
=
provision_get_site_data
(
$url
);
$args
=
func_get_args
();
array_shift
(
$args
);
$file
=
array_shift
(
$args
);
_provision_backup_site
(
$url
,
$data
,
$file
);
provision_save_site_data
(
$url
,
$data
);
provision_output
(
$url
,
$data
);
}
/**
* Generate a backup tarbal for a site.
*/
function
_provision_backup_site
(
$url
,
&
$data
,
$file
=
null
)
{
$backup_path
=
_provision_backup_path
();
// This is the actual drupal provisioning requirements.
if
(
!
is_dir
(
$backup_path
))
{
...
...
@@ -480,9 +496,7 @@ function _provision_backup($url) {
provision_set_error
(
PROVISION_PERM_ERROR
);
provision_output
(
$url
,
$data
);
}
$args
=
func_get_args
();
array_shift
(
$args
);
$file
=
array_shift
(
$args
);
if
(
is_file
(
$file
))
{
provision_log
(
"File specified already exists."
);
provision_set_error
(
PROVISION_PERM_ERROR
);
...
...
@@ -500,9 +514,6 @@ function _provision_backup($url) {
$rolled_back
=
provision_invoke
(
"backup"
,
$url
,
$data
);
provision_shell_exec
(
"gzip %s"
,
$data
[
'backup_file'
]);
$data
[
'backup_file'
]
=
$data
[
'backup_file'
]
.
'.gz'
;
provision_save_site_data
(
$url
,
$data
);
provision_output
(
$url
,
$data
);
}
/**
...
...
@@ -609,3 +620,14 @@ function _provision_verify($url = '') {
}
provision_output
(
$url
,
$data
);
}
function
_provision_restore
(
$site
,
$backup_file
)
{
if
(
!
_provision_drupal_site_exists
(
$url
))
{
provision_log
(
"Error"
,
"Site has not been installed yet."
);
provision_set_error
(
PROVISION_SITE_NOT_FOUND
);
provision_output
(
$url
,
$data
);
}
$data
=
provision_get_site_data
(
$url
);
_provision_backup_site
(
$url
,
$data
);
# Backup site for posterity, before rolling back.
provision_save_site_data
(
$url
,
$data
);
}
Write
Preview
Markdown
is supported
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