This repository has been archived on 2024-10-16. You can view files and clone it, but cannot push or open issues or pull requests.
pflaenz.li-Symfony/deploy.php

59 lines
1.4 KiB
PHP
Raw Normal View History

2021-05-07 15:27:49 +02:00
<?php
namespace Deployer;
2022-01-11 20:31:44 +01:00
require 'recipe/symfony4.php';
2021-05-07 15:27:49 +02:00
// Project name
2022-01-11 20:31:44 +01:00
set('application', 'beta.pflaenz.li');
2021-05-07 15:27:49 +02:00
// Project repository
2022-01-11 20:31:44 +01:00
set('repository', 'ssh://git@git.thisfro.ch:222/thisfro/pflaenz.li.git');
2021-05-07 15:27:49 +02:00
// [Optional] Allocate tty for git clone. Default value is false.
set('git_tty', true);
// Shared files/dirs between deploys
add('shared_files', []);
add('shared_dirs', []);
// Writable dirs by web server
add('writable_dirs', []);
2022-01-11 20:31:44 +01:00
// Set composer options
set('composer_options', '{{composer_action}} --verbose --prefer-dist --no-progress --no-interaction --optimize-autoloader --no-scripts');
2021-05-07 15:27:49 +02:00
// Hosts
2022-01-11 20:31:44 +01:00
host('beta.xn--pflnz-ira.li')
->user('lq5xi_thisfro')
->set('deploy_path', '~/sites/{{application}}');
set('http_user', 'uid153060');
2021-05-07 15:27:49 +02:00
// Tasks
2022-01-11 20:31:44 +01:00
task('upload:build', function() {
upload('public/build/', '{{release_path}}/public/build/');
2021-05-07 15:27:49 +02:00
});
2022-01-11 20:31:44 +01:00
// Build yarn locally
task('deploy:build:assets', function (): void {
run('yarn install');
run('yarn encore production');
})->local()->desc('Install front-end assets');
before('deploy:symlink', 'deploy:build:assets');
// Upload assets
task('upload:assets', function (): void {
upload(__DIR__.'/public/build/', '{{release_path}}/public/build');
});
after('deploy:build:assets', 'upload:assets');
2021-05-07 15:27:49 +02:00
// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');
// Migrate database before symlink new release.
before('deploy:symlink', 'database:migrate');