mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 09:12:51 +01:00
Adds check for existing /current directory to deploy:prepare
This commit is contained in:
parent
9bce6316ac
commit
ac401ea2b2
@ -103,6 +103,13 @@ task('deploy:prepare', function () {
|
||||
|
||||
run('if [ ! -d {{deploy_path}} ]; then mkdir -p {{deploy_path}}; fi');
|
||||
|
||||
// Check for existing /current directory (not symlink)
|
||||
$result = run('if [ ! -L {{deploy_path}}/current ] && [ -d {{deploy_path}}/current ]; then echo 1; fi')->toString();
|
||||
if ($result)
|
||||
{
|
||||
throw new RuntimeException('There already is a directory (not symlink) named "current" in the deploy_path. Remove this directory so it can be replaced with a symlink for atomic deployments.');
|
||||
}
|
||||
|
||||
// Create releases dir.
|
||||
run("cd {{deploy_path}} && if [ ! -d releases ]; then mkdir releases; fi");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user