deployer
deployer copied to clipboard
Deployer hang on success or fail on gitlab runner shell
- Deployer version: 7
- Deployment OS: Centos 7 - Plesk
- Gitlab 15.2
It seems that it does not return status exit.
deploy.php
require 'recipe/cakephp.php';
set('ssh_multiplexing', true);
set('bin/composer', function () { return '{{bin/php}} /usr/lib64/plesk-9.0/composer.phar'; });
$config = []; $configFile = dirname(dirname(FILE)) . '/.deploy.ini'; if (file_exists($configFile)) { $config = parse_ini_file($configFile); }
$getConfig = function (string $key) use ($config): ?string { if ($envValue = getenv($key)) { return $envValue; }
return $config[$key] ?? null;
}; $projectName = $getConfig('DEPLOY_PROJECT_NAME') ?? 'project';
set('repository', '[email protected]:programadorwebfreelance/{$projectName}.git');
host('master') ->setHostname( '$projectName.master.xxxx.com") ->setIdentityFile('~/.ssh/id_rsa') ->setRemoteUser($getConfig('SERVER_USER')) ->setSshArguments(['-o UserKnownHostsFile=/dev/null']) ->set('branch', 'master') ->set('composer_options', '--verbose --prefer-dist --optimize-autoloader --no-progress --no-interaction') ->set('deploy_path', '/var/www/vhosts/xxx.xcom'.$projectName.'/master');
set('shared_dirs', [ 'logs', 'files', ]);
set('shared_files', [ 'config/app_local.php', 'config/asset_compress.local.ini', ]);
task('deploy:run_migrations', function () { run('{{bin/php}} {{release_path}}/bin/cake.php migrations migrate --no-lock'); run('{{bin/php}} {{release_path}}/bin/cake.php schema_cache build'); })->desc('Run migrations, clear all caches');