forked from kraftwagen/kraftwagen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kraftwagen.drush.inc
150 lines (130 loc) · 5.31 KB
/
kraftwagen.drush.inc
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?php
/**
* @file
* Kraftwagen provides drush command for a _everything in code_ and _install
* profile_ based Drupal development workflow.
*/
/**
* Implements hook_drush_command().
*/
function kraftwagen_drush_command() {
$items = array();
$items['kw-new-project'] = array(
'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,
'description' => dt('Create a new project. This will create an new source directory from a Git skeleton repository.'),
'arguments' => array(
'directory' => dt('The directory to create the project in. Defaults to the current directory'),
),
'aliases' => array('kw-np'),
'options' => array(
'force' => dt('Forces execution of this command, even if the specified source dir already exists.'),
),
);
$items['kw-build'] = array(
'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,
'description' => dt('Create a build from the source'),
'aliases' => array('kw-b'),
);
$items['kw-generate-makefile'] = array(
'hidden' => TRUE,
'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,
'description' => dt('Generate a new make file from the source'),
'arguments' => array(
'location' => dt('The location where to store the new makefile')
),
'required-arguments' => 1,
);
$items['kw-activate-build'] = array(
'hidden' => TRUE,
'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,
'description' => dt('Link a symlink to the specified build'),
'arguments' => array(
'build' => dt('The location of the build'),
),
'required-arguments' => 1,
);
$items['kw-update-makefile'] = array(
'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,
'description' => dt('Update an existing makefile to the newest version of contributed modules. This will NOT do any major updates.'),
'arguments' => array(
'makefile.make' => dt('The makefile to update. As this command will actually change this file, it should be readable and writeable, and you should backup it, or have it under version control.'),
'source_dir' => dt('The location of the source directory'),
),
'required-arguments' => 1,
'aliases' => array('kw-um'),
);
$items['kw-update'] = array(
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_LOGIN,
'description' => dt('Update a Kraftwagen project. Runs all commands necessary to bring the database in sync with code in the build.'),
'aliases' => array('kw-u'),
);
$items['kw-apply-module-dependencies'] = array(
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_LOGIN,
'description' => dt('Check if all required modules are enabled, enable them if they are not, and disable them if the are enabled, but not required.'),
'arguments' => array(
'environment' => dt('The environment to use for environment specific dependencies. Defaults to production.'),
),
'aliases' => array('kw-amd'),
);
$items['kw-init-database'] = array(
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_SITE,
'description' => dt('Initialize (or re-initialize) the database for a Kraftwagen build.'),
'aliases' => array('kw-id'),
);
$items['kw-setup'] = array(
'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,
'description' => dt('Sets up the environment, settings files and uploaded files directory for a Kraftwagen project.'),
'aliases' => array('kw-s'),
);
$items['kw-setup-env'] = array(
'hidden' => TRUE,
'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,
'description' => dt('Attempts to create an empty environment, defaulting to \'production\', for a Kraftwagen project.'),
);
$items['kw-setup-settings'] = array(
'hidden' => TRUE,
'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,
'description' => dt('Attempts to copy the settings files from the source into the correct location for a Kraftwagen project.'),
);
$items['kw-setup-upload-dir'] = array(
'hidden' => TRUE,
'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,
'description' => dt('Attempts to create the \'user uploaded files\' directory for a Kraftwagen project.'),
);
$items['kw-setup-symlinks'] = array(
'hidden' => TRUE,
'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,
'description' => dt('Creates or recreates symlinks for the settings files and the uploaded files directory into the specified Kraftwagen build.'),
'arguments' => array(
'build' => dt('The build to create the symlinks in. Defaults to the currently active build.'),
),
);
$items['kw-setup-symlink'] = array(
'hidden' => TRUE,
'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,
'description' => dt('Creates or recreates a symlink into the specified Kraftwagen build.'),
'aliases' => array('kw-bs'),
'arguments' => array(
'build' => dt('The build to create the symlink in.'),
'name' => dt('The name of the file or dir to symlink.')
),
'required-arguments' => 2,
);
$items['kw-import-translations'] = array(
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_LOGIN,
'description' => dt('Import all .po files in the project for enabled components.'),
'aliases' => array('kw-it'),
'drupal dependencies' => array('locale'),
);
return $items;
}
/**
* Implements hook_drush_init().
*/
function kraftwagen_drush_init() {
require_once dirname(__FILE__) . '/includes/kraftwagen.commands.inc';
// Load the context handling and fill it with the default values in
// kraftwagenrc.php.
require_once dirname(__FILE__) . '/includes/kraftwagen.context.inc';
kraftwagen_context_load_default_config();
}