25 lines
659 B
PHP
Raw Normal View History

2020-10-11 00:08:50 +02:00
<?php
namespace Deployer;
// Creates patch of local changes and pushes them on host.
// And applies to current_path. Push can be done many times.
// The task purpose to be used only for development.
desc('Push local changes to remote host');
task('push', function () {
2021-03-16 22:08:23 +01:00
$files = explode("\n", runLocally("git diff --name-only HEAD"));
2020-10-11 00:08:50 +02:00
2021-03-16 22:08:23 +01:00
info('uploading:');
foreach ($files as $file) {
writeln(" - $file");
}
2020-10-11 00:08:50 +02:00
2021-03-16 22:08:23 +01:00
upload(
$files,
'{{current_path}}',
['progress_bar' => false, 'options' => ['--relative']]
);
2020-10-11 00:08:50 +02:00
2021-03-16 22:08:23 +01:00
// Mark this release as dirty.
run("echo '{{user}}' > {{current_path}}/DIRTY_RELEASE");
2020-10-11 00:08:50 +02:00
});