Skip to content

Commit

Permalink
chore(app): Add deploy.php
Browse files Browse the repository at this point in the history
  • Loading branch information
flemzord committed Aug 6, 2024
1 parent a45277c commit b9e3917
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 1 deletion.
5 changes: 5 additions & 0 deletions apps/app/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"livewire/livewire": "^3.0"
},
"require-dev": {
"deployer/deployer": "^7.4",
"fakerphp/faker": "^1.23",
"laravel/pint": "^1.13",
"mockery/mockery": "^1.6",
Expand Down Expand Up @@ -47,7 +48,11 @@
"@php artisan key:generate --ansi",
"@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
"@php artisan migrate --graceful --ansi"
],
"deploy": [
"./vendor/bin/dep deploy"
]

},
"extra": {
"laravel": {
Expand Down
45 changes: 44 additions & 1 deletion apps/app/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions apps/app/deploy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

namespace Deployer;

require 'recipe/laravel.php';
require 'recipe/deploy/writable.php';

set('repository', 'git@github.com:flemzord/getlicensed.dev.git');
//set('dotenv', '{{current_path}}/.env');
set('http_user', 'www-data');
set('http_group', 'www-data');
//set('become', 'www-data');
set('writable_recursive', true);
set('sub_directory', 'apps/app');

add('shared_files', []);
add('shared_dirs', []);
add('writable_dirs', []);

task('deploy:npm', function () {
cd('{{release_path}}');
run('npm install');
run('npm run build');
});

task('deploy:chown', function () {
cd('{{release_path}}');
run('chown -R www-data:www-data .');
});

// Hosts
host('157.90.147.230')
->set('remote_user', 'root')
->set('deploy_path', '/var/www/app.getlicensed.dev');

// Hooks
after('deploy:failed', 'deploy:unlock');
after('deploy:vendors', 'deploy:npm');
after('artisan:migrate', 'deploy:chown');

0 comments on commit b9e3917

Please sign in to comment.