Initial commit

This commit is contained in:
Chris Smith
2025-02-19 14:51:16 +01:00
commit d82a6cad96
198 changed files with 13819 additions and 0 deletions

54
deploy.php Normal file
View File

@@ -0,0 +1,54 @@
<?php
namespace Deployer;
require 'recipe/yii.php';
// Config
set('repository', 'git@github.com:cgsmith/calorie.git');
add('shared_files', [
//'yii',
'common/config/main-local.php',
'common/config/params-local.php',
'frontend/config/main-local.php',
'frontend/config/params-local.php',
]);
add('shared_dirs', []);
add('writable_dirs', []);
// Hosts
host('calorie')
->set('remote_user', 'root')
->set('deploy_path', '/var/www/calorie')
->set('environment', 'Production')
->setLabels([
'env' => 'prod',
]);
host('test.calorie')
->set('composer_options', '--verbose --prefer-dist --no-progress --no-interaction')
->set('remote_user', 'root')
->set('deploy_path', '/var/www/test.calorie')
->set('environment', 'Testing')
->setLabels([
'env' => 'test',
]);
// Tasks
task('init-app', function () {
run('cd {{release_or_current_path}} && {{bin/php}} init --env={{environment}} --overwrite=n');
});
desc('Restart yii queue workers');
task('yii:queue:restart', function () {
run('systemctl restart yii-queue@*');
});
task('deploy:prod', function() {
invoke('yii:queue:restart');
})->select('env=prod');
// Hooks
after('deploy:vendors', 'init-app');
after('deploy:failed', 'deploy:unlock');
after('deploy', 'deploy:prod');