Skip to content

Commit 2642a0d

Browse files
committed
Merge pull request pocketarc#64 from Tornskaden/laravel_maintenance_option
Optionally delete maintenance_file at the end of deployment
2 parents d4a8ad1 + 4d7c09d commit 2642a0d

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

README.mkd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ It works by modifying a file specified by the `maintenance_file` option in your
130130

131131
Note: It's up to your application to detect whether or not maintenance mode is on by checking the `maintenance_file`, and proceed accordingly.
132132

133+
Some frameworks looks for a file at a specific location and shows it's maintenance page if the file exists disregarding the content of the file. The file can be deleted at the end of deployment by not setting `maintenance_off_value`.
134+
This example works with Laravel 5:
135+
maintenance_file = 'storage/framework/down'
136+
maintenance_on_value = 'Down for maintenance'
137+
133138
How It Works
134139
------------
135140
git-deploy stores a file called REVISION on your server. This file contains the hash of the commit that you've deployed to that server. When you run git-deploy, it downloads that file and compares the commit reference in it with the commit you're trying to deploy to find out which files to upload.

git-deploy

-30.1 KB
Binary file not shown.

tools/src/Server.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,10 @@ protected function set_current_commit($target_commit, $list_only = false) {
164164
}
165165

166166
if (isset($this->server['maintenance_file'])) {
167-
$this->set_file($this->server['maintenance_file'], $this->server['maintenance_off_value']);
167+
if (isset($this->server['maintenance_off_value']))
168+
$this->set_file($this->server['maintenance_file'], $this->server['maintenance_off_value']);
169+
else
170+
$this->unset_file($this->server['maintenance_file']);
168171
Helpers::logmessage("Turned maintenance mode off.");
169172
}
170173

0 commit comments

Comments
 (0)