-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.RoboFile.php
More file actions
76 lines (56 loc) · 1.7 KB
/
example.RoboFile.php
File metadata and controls
76 lines (56 loc) · 1.7 KB
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
<?php
// @codingStandardsIgnoreStart
use Robo\Result;
use Robo\Tasks;
/**
* Base tasks for setting up a module to test within a full Drupal environment.
*
* @see http://robo.li/
*/
class RoboFile extends Tasks {
/**
* Command for Drupal Update.
*
* @return \Robo\Result
* The result of the collection of tasks.
*/
public function drupalUpdate(): Result {
// Create collection.
$collection = $this->collectionBuilder();
// Init tasks.
$tasks = [];
// Clear cache.
$tasks[] = $this->drush()->arg('cache:rebuild');
// Maintenance "On".
$tasks[] = $this->drush()->args('state:set', 'system.maintenance', '1');
// Drupal update.
$tasks[] = $this->drush()->arg('updatedb')->option('no-post-updates')->option('yes');
// Translation update.
$tasks[] = $this->drush()->arg('locale:check');
$tasks[] = $this->drush()->arg('locale:update');
// Sync configuration.
$tasks[] = $this->drush()->args('config:import', 'sync')->option('yes');
// Drupal update.
$tasks[] = $this->drush()->arg('updatedb')->option('yes');
// Maintenance "Off".
$tasks[] = $this->drush()->args('state:set', 'system.maintenance', '0');
// Clear cache.
$tasks[] = $this->drush()->arg('cache:rebuild');
// Drupal status.
$tasks[] = $this->drush()->arg('core:status');
// Message.
$collection->progressMessage("Drupal Update");
// Add tasks in collection.
$collection->addTaskList($tasks);
return $collection->run();
}
/**
* Return drush with default arguments.
*
* @return \Robo\Task\Base\Exec
* A drush exec command.
*/
protected function drush() {
return $this->taskExec('vendor/bin/drush');
}
}