Skip to content

Deployer hang on success or fail on gitlab runner shell #3256

Description

@programadorwebfreelance
  • 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', 'git@git.xxxxx.com: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');

Captura de Pantalla 2022-08-06 a las 18 44 18

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions