This repository has been archived by the owner on Sep 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 217
/
Update.php
70 lines (59 loc) · 1.71 KB
/
Update.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
/*
* This file is part of Rocketeer
*
* (c) Maxime Fabre <ehtnam6@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Rocketeer\Tasks;
/**
* Update the remote server without doing a new release.
*
* @author Maxime Fabre <ehtnam6@gmail.com>
*/
class Update extends Deploy
{
/**
* A description of what the task does.
*
* @type string
*/
protected $description = 'Update the remote server without doing a new release';
/**
* Run the task.
*
* @return bool|null
*/
public function execute()
{
// Check if local is ready for deployment
if (!$this->executeTask('Primer')) {
return $this->halt('Project is not ready for deploy. You were almost fired.');
}
// Update repository
if (!$this->getStrategy('Deploy')->update()) {
return $this->halt();
}
// Recreate symlinks if necessary
$this->steps()->syncSharedFolders();
// Recompile dependencies and stuff
$this->steps()->executeTask('Dependencies');
// Set permissions
$this->steps()->setApplicationPermissions();
// Run migrations
if ($this->getOption('migrate') || $this->getOption('seed')) {
$this->steps()->executeTask('Migrate');
}
// Run the steps
if (!$this->runSteps()) {
return $this->halt();
}
// Clear cache
if (!$this->getOption('no-clear')) {
$this->artisan()->runForCurrentRelease('clearCache');
}
return $this->command->info('Successfully updated application');
}
}