mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 01:02:24 +01:00
Merge pull request #240 from Max-Might/master
Improve symlink check in deploy:release task
This commit is contained in:
commit
ece5b44702
@ -83,7 +83,7 @@ task('deploy:release', function () {
|
||||
|
||||
run("mkdir $releasePath");
|
||||
|
||||
run("cd {{deploy_path}} && if [ -e release ]; then rm release; fi");
|
||||
run("cd {{deploy_path}} && if [ -h release ]; then rm release; fi");
|
||||
|
||||
run("ln -s $releasePath {{deploy_path}}/release");
|
||||
})->desc('Prepare release');
|
||||
|
@ -29,6 +29,21 @@ class CommonTest extends RecipeTester
|
||||
$this->assertFileExists(self::$deployPath . '/release');
|
||||
}
|
||||
|
||||
public function testReleaseSymlink()
|
||||
{
|
||||
$directory = self::$deployPath . '/directory';
|
||||
$releaselink = self::$deployPath . '/release';
|
||||
$releasedir = readlink($releaselink);
|
||||
|
||||
mkdir($directory);
|
||||
unlink($releaselink);
|
||||
symlink($directory, $releaselink);
|
||||
rmdir($directory);
|
||||
|
||||
$this->exec('deploy:release');
|
||||
$this->assertFileExists($releaselink);
|
||||
}
|
||||
|
||||
public function testUpdateCode()
|
||||
{
|
||||
set('repository', 'https://github.com/deployphp/test.git');
|
||||
|
Loading…
x
Reference in New Issue
Block a user