Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
provision
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
provision
Commits
04ec33c4
Commit
04ec33c4
authored
15 years ago
by
Neil Drumm
Committed by
Neil Drumm
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Handle context deletion
parent
39c0c45c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
provision.config.inc
+6
-9
6 additions, 9 deletions
provision.config.inc
provision.drush.inc
+13
-3
13 additions, 3 deletions
provision.drush.inc
provision_drushrc_alias.tpl.php
+1
-3
1 addition, 3 deletions
provision_drushrc_alias.tpl.php
with
20 additions
and
15 deletions
provision.config.inc
+
6
−
9
View file @
04ec33c4
...
...
@@ -151,18 +151,15 @@ class provisionConfig_drushrc_alias extends provisionConfig_drushrc {
* @code '\@name' => array('option1', 'option2'), @endcode
* will save the current values of option1 and option2 to @name.
*/
function
__construct
(
$contexts
)
{
$contexts_expanded
=
array
();
foreach
(
$contexts
as
$name
=>
$options
)
{
$contexts_expanded
[
$name
]
=
array
();
foreach
(
$options
as
$key
)
{
$contexts_expanded
[
$name
][
$key
]
=
drush_get_option
(
$key
);
}
function
__construct
(
$name
,
$options
=
array
())
{
$options_expanded
=
array
();
foreach
(
$options
as
$key
)
{
$options_expanded
[
$key
]
=
drush_get_option
(
$key
);
}
$this
->
data
=
array
(
'aliasname'
=>
reset
(
array_keys
(
$contexts
))
,
'
contexts'
=>
$context
s_expanded
,
'aliasname'
=>
$name
,
'
options'
=>
$option
s_expanded
,
);
}
...
...
This diff is collapsed.
Click to expand it.
provision.drush.inc
+
13
−
3
View file @
04ec33c4
...
...
@@ -76,6 +76,11 @@ function provision_drush_command() {
'description'
=>
dt
(
'Save Drush aliases'
),
'bootstrap'
=>
DRUSH_BOOTSTRAP_DRUSH
,
);
$items
[
'provision-named-context-delete'
]
=
array
(
'arguments'
=>
array
(),
'description'
=>
dt
(
'Delete Drush aliases'
),
'bootstrap'
=>
DRUSH_BOOTSTRAP_DRUSH
,
);
$items
[
'provision-install'
]
=
array
(
'arguments'
=>
array
(
'domain.com'
=>
dt
(
'The domain of the site to install.'
)),
'description'
=>
dt
(
'Provision a new site using the provided data.'
),
...
...
@@ -214,20 +219,25 @@ function drush_http_provision_named_context_save() {
foreach
(
provision_service
(
'all'
)
as
$service
)
{
$options
=
array_merge
(
$options
,
$service
->
write_alias
());
}
$config
=
new
provisionConfig_drushrc_alias
(
array
(
drush_get_option
(
'hosting_name'
)
=>
$options
)
)
;
$config
=
new
provisionConfig_drushrc_alias
(
drush_get_option
(
'hosting_name'
)
,
$options
);
$config
->
write
();
}
elseif
(
PROVISION_CONTEXT_PLATFORM
)
{
drush_set_option
(
'platform-name'
,
preg_replace
(
'/^platform_/'
,
''
,
drush_get_option
(
'hosting_name'
)));
$config
=
new
provisionConfig_drushrc_alias
(
array
(
drush_get_option
(
'hosting_name'
)
=>
array
(
'provision-http-server'
,
'provision-context'
,
'root'
,
'platform-name'
))
)
;
$config
=
new
provisionConfig_drushrc_alias
(
drush_get_option
(
'hosting_name'
)
,
array
(
'provision-http-server'
,
'provision-context'
,
'root'
,
'platform-name'
));
$config
->
write
();
}
elseif
(
PROVISION_CONTEXT_SITE
)
{
$config
=
new
provisionConfig_drushrc_alias
(
array
(
drush_get_option
(
'hosting_name'
)
=>
array
(
'provision-db-server'
,
'provision-platform'
,
'provision-context'
,
'uri'
,
'site_port'
,
'site_id'
,
'language'
,
'client_email'
))
)
;
$config
=
new
provisionConfig_drushrc_alias
(
drush_get_option
(
'hosting_name'
)
,
array
(
'provision-db-server'
,
'provision-platform'
,
'provision-context'
,
'uri'
,
'site_port'
,
'site_id'
,
'language'
,
'client_email'
));
$config
->
write
();
}
}
function
drush_http_provision_named_context_delete
()
{
$config
=
new
provisionConfig_drushrc_alias
(
drush_get_option
(
'hosting_name'
));
$config
->
unlink
();
}
function
_provision_default_restart_cmd
()
{
$command
=
'/usr/sbin/apachectl'
;
// A proper default for most of the world
foreach
(
explode
(
':'
,
$_SERVER
[
'PATH'
])
as
$path
)
{
...
...
This diff is collapsed.
Click to expand it.
provision_drushrc_alias.tpl.php
+
1
−
3
View file @
04ec33c4
<?php
print
"<?php
\n
"
;
?>
<?php
foreach
(
$contexts
as
$name
=>
$data
)
{
?>
$aliases['
<?php
print
$name
;
?>
'] =
<?php
print
var_export
(
$data
,
TRUE
);
?>
;
<?php
}
?>
$aliases['
<?php
print
$aliasname
;
?>
'] =
<?php
print
var_export
(
$options
,
TRUE
);
?>
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment