$database) { $array[$database] = $start + $index; } } return $array; }); // Composer specific set('composer_options', '{{composer_action}} --verbose --prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader'); // Git specifc values set('bin/git', static function (): string { return 'GIT_SSH_COMMAND="ssh -i ~/.ssh/' . get('ssh_key') . '" ' . locateBinaryPath('git'); }); set('repository_url_parts', static function (): array { preg_match( '/^(?:(?[^@]*)@)?(?[^:]*):(?.*\/(?.*))\.git$/', get('repository'), $urlParts ); return $urlParts; }); set('repository_short_name', static function (): string { return get('repository_url_parts')['short_name']; }); set('repository_link', static function (): string { return 'https://' . get('repository_url_parts')['host'] . '/' . get('repository_url_parts')['path']; }); set('deploy_user', static function (): string { $user = getenv('GIT_AUTHOR_NAME'); if ($user === false) { $user = getenv('GIT_COMMITTER_NAME'); if ($user === false) { $getUserCommand = 'git config --get user.name'; if (!testLocally("$getUserCommand 2>/dev/null || true")) { $user = runLocally($getUserCommand); } else { $user = get('user'); } } } return $user; }); set('git_commit_types', [ 'Fix' => 'A bug fix', 'Update' => 'A backwards-compatible enhancement', 'Breaking' => 'A backwards-incompatible enhancement', 'Docs' => 'Documentation change', 'Build' => 'Build process update', 'New' => 'A new feature implementation', 'Upgrade' => 'Dependency upgrade', 'Chore' => 'Other changes (e.g.: refactoring)', ]); // Connection specifc values set('port', 22); set('forwardAgent', false); set('multiplexing', true); set('ssh_key', get('repository_short_name')); // Server specifc values set('editor', 'nano'); set('html_path', '/var/www/virtual/{{user}}'); set('deploy_path', '{{html_path}}/{{deploy_folder}}'); set('db_backup_folder', '{{deploy_path}}/.dep/databases/dumps'); set('db_backup_keep_dumps', 5); set('deploy_folder', static function (): string { $suffix = ''; if (has('stage')) { $suffix = "/" . ucfirst(get('stage')); } return get('repository_short_name') . $suffix; }); set('db_password', static function (): string { return run('my_print_defaults client | grep -Po "password=\K(\S)*"'); }); set('release_name', static function (): string { return run('date +"%Y-%m-%d__%H-%M-%S"'); }); // Slack specifc values set('slack_application', static function (): string { return get('application', getRealHostname()); }); set('slack_title', '{{slack_application}} (Neos)'); set('slack_text', '_{{deploy_user}}_ deploying *{{repository_short_name}}* on `{{branch}}` to *{{target}}*'); set('slack_success_text', 'Deploy from *{{repository_short_name}}* to *{{target}}* successful'); set('slack_failure_text', 'Deploy from *{{repository_short_name}}* to *{{target}}* failed'); set('slack_color', '#4d91f7'); set('slack_success_color', '#00c100'); set('slack_failure_color', '#ff0909');