* deploy added
* semantic-ui removed * image display reworked
This commit is contained in:
73
deploy.php
Normal file
73
deploy.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace Deployer;
|
||||
require 'recipe/common.php';
|
||||
|
||||
set('ssh_type', 'native');
|
||||
set('ssh_multiplexing', true);
|
||||
|
||||
// Configuration
|
||||
|
||||
// set('repository', 'git@domain.com:username/repository.git');
|
||||
set('shared_files', []);
|
||||
set('shared_dirs', []);
|
||||
set('writable_dirs', []);
|
||||
set('keep_releases', 3);
|
||||
set('default_stage', 'production');
|
||||
|
||||
// Servers
|
||||
server('alfheim', 'alfheim.ragnarok.yvan.hu')
|
||||
->stage('production')
|
||||
->user('yvan')
|
||||
->identityFile()
|
||||
->set('ng_target', 'production')
|
||||
->set('ng_environment', 'prod')
|
||||
->set('env_vars', 'NODE_ENV=production')
|
||||
->set('deploy_path', '/var/www/photos/frontend');
|
||||
|
||||
// Tasks
|
||||
desc('Prepare release');
|
||||
task('deploy:ng-prepare', function() {
|
||||
runLocally("ng build --target={{ng_target}} --environment={{ng_environment}}");
|
||||
runLocally("ng build --target={{ng_target}} --environment={{ng_environment}} --app ssr --output-hashing=none");
|
||||
runLocally("tar -cJf dist.tar.xz dist dist-ssr render.js package.json pm2.json");
|
||||
});
|
||||
|
||||
desc('Upload release');
|
||||
task('deploy:ng-upload', function() {
|
||||
upload("dist.tar.xz", "{{release_path}}/dist.tar.xz");
|
||||
run("tar -C {{release_path}} -xJf {{release_path}}/dist.tar.xz");
|
||||
within("{{release_path}}", function () {
|
||||
run("npm install --production");
|
||||
run("npm install express --production");
|
||||
});
|
||||
run("rm -f {{release_path}}/dist.tar.xz");
|
||||
runLocally("rm -rf dist.tar.xz dist dist-ssr");
|
||||
});
|
||||
|
||||
desc('Start app server');
|
||||
task('deploy:node-restart', function() {
|
||||
within("{{release_path}}", function () {
|
||||
run("pm2 stop --silent gallery-frontend");
|
||||
run("pm2 delete --silent gallery-frontend");
|
||||
|
||||
run("pm2 start pm2.json");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
desc('Deploy your project');
|
||||
task('deploy', [
|
||||
'deploy:prepare',
|
||||
'deploy:lock',
|
||||
'deploy:release',
|
||||
'deploy:ng-prepare',
|
||||
'deploy:ng-upload',
|
||||
'deploy:shared',
|
||||
'deploy:clear_paths',
|
||||
'deploy:symlink',
|
||||
'deploy:node-restart',
|
||||
'deploy:unlock',
|
||||
'cleanup',
|
||||
]);
|
||||
after('deploy', 'success');
|
||||
Reference in New Issue
Block a user