This repository was archived by the owner on Jan 21, 2025. It is now read-only.
forked from skwashd/drupal-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.api.php
70 lines (63 loc) · 1.67 KB
/
deploy.api.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**
* @file
* Hooks provided by the Deploy module.
*/
/**
* Allow modules to modify an entity before it gets deployed.
*
* @param $entity
* The entity being deployed.
*
* @param $entity_type
* The entity type; for example 'node' or 'user'.
*/
function hook_deploy_entity_alter(&$entity, $entity_type) {
}
/**
* Allow modules to add preprocess or postprocess callbacks to a deployment.
*
* @return array
* A nested array containing preprocess and/or postprocess operations. The
* first level of the array needs to contain the keys 'postprocess' and/or
* 'preprocess'.
*
* The second level is an array of operations, where each operation contains a
* 'callback' key with the name of the function to be run. Each callback
* function accepts two parameters:
* - plan_name: The machine name of the deployment plan.
* - entity: The entity being deployed.
*
* @see DeployProcessor::preProcess()
* @see DeployProcessor::postProcess()
*/
function hook_deploy_operation_info() {
return array(
'postprocess' => array(
array('callback' => 'deploy_manager_postprocess_operation'),
),
);
}
/**
* Allow module to alter a deploy plan when it is loaded.
*
* @param $plan
* The deployment plan to be altered.
*/
function hook_deploy_plan_load_alter(&$plan) {
}
/**
* Allow module to react to publishing a deploy plan.
*
* @param $status
* The boolean result of publishing the plan.
*/
function hook_deploy_plan_publish($status) {
// Set a message based on the deployment result.
if ($status) {
drupal_set_message(t('Deployment was successful.'));
}
else {
drupal_set_message(t('Deployment failed.'), 'error');
}
}