deployphp /
deployer
| 1 | <?php |
||
| 2 | /* (c) Anton Medvedev <[email protected]> |
||
| 3 | * |
||
| 4 | * For the full copyright and license information, please view the LICENSE |
||
| 5 | * file that was distributed with this source code. |
||
| 6 | */ |
||
| 7 | |||
| 8 | namespace Deployer; |
||
| 9 | |||
| 10 | use Symfony\Component\Console\Output\Output; |
||
| 11 | |||
| 12 | class YamlTest extends AbstractTest |
||
|
0 ignored issues
–
show
Deprecated Code
introduced
by
Loading history...
|
|||
| 13 | { |
||
| 14 | public const RECIPE = __DIR__ . '/recipe/deploy.yaml'; |
||
| 15 | |||
| 16 | public function testDeploy() |
||
| 17 | { |
||
| 18 | $this->init(self::RECIPE); |
||
| 19 | $this->deployer->config->set('repository', __REPOSITORY__); |
||
| 20 | $this->tester->run([ |
||
| 21 | 'deploy', |
||
| 22 | 'selector' => 'all', |
||
| 23 | '-f' => self::RECIPE, |
||
| 24 | ], [ |
||
| 25 | 'verbosity' => Output::VERBOSITY_VERBOSE, |
||
| 26 | 'interactive' => false, |
||
| 27 | ]); |
||
| 28 | |||
| 29 | $display = $this->tester->getDisplay(); |
||
| 30 | self::assertEquals(0, $this->tester->getStatusCode(), $display); |
||
| 31 | |||
| 32 | foreach ($this->deployer->hosts as $host) { |
||
| 33 | $deployPath = $host->get('deploy_path'); |
||
| 34 | |||
| 35 | self::assertDirectoryExists($deployPath . '/.dep'); |
||
| 36 | self::assertDirectoryExists($deployPath . '/releases'); |
||
| 37 | self::assertDirectoryExists($deployPath . '/shared'); |
||
| 38 | self::assertDirectoryExists($deployPath . '/current'); |
||
| 39 | self::assertDirectoryExists($deployPath . '/current/'); |
||
| 40 | self::assertFileExists($deployPath . '/current/README.md'); |
||
| 41 | self::assertDirectoryExists($deployPath . '/current/storage/logs'); |
||
| 42 | self::assertDirectoryExists($deployPath . '/current/storage/db'); |
||
| 43 | self::assertDirectoryExists($deployPath . '/shared/storage/logs'); |
||
| 44 | self::assertDirectoryExists($deployPath . '/shared/storage/db'); |
||
| 45 | self::assertFileExists($deployPath . '/shared/uploads/poem.txt'); |
||
| 46 | self::assertFileExists($deployPath . '/shared/.env'); |
||
| 47 | self::assertFileExists($deployPath . '/current/config/test.yaml'); |
||
| 48 | self::assertFileExists($deployPath . '/shared/config/test.yaml'); |
||
| 49 | self::assertEquals(1, intval(`cd $deployPath && ls -1 releases | wc -l`)); |
||
| 50 | } |
||
| 51 | } |
||
| 52 | } |
||
| 53 |