diff --git a/recipe/common.php b/recipe/common.php index 2cf7d004..ebcc92ff 100644 --- a/recipe/common.php +++ b/recipe/common.php @@ -11,6 +11,7 @@ require __DIR__ . '/deploy/release.php'; require __DIR__ . '/deploy/rollback.php'; require __DIR__ . '/deploy/setup.php'; require __DIR__ . '/deploy/shared.php'; +require __DIR__ . '/deploy/status.php'; require __DIR__ . '/deploy/symlink.php'; require __DIR__ . '/deploy/update_code.php'; require __DIR__ . '/deploy/vendors.php'; diff --git a/recipe/deploy/info.php b/recipe/deploy/info.php index b1f4e90c..7a8e2b15 100644 --- a/recipe/deploy/info.php +++ b/recipe/deploy/info.php @@ -1,6 +1,25 @@ hasOption('tag') && !empty(input()->getOption('tag'))) { + $t = input()->getOption('tag'); + } + if (input()->hasOption('revision') && !empty(input()->getOption('revision'))) { + $t = input()->getOption('revision'); + } + if (empty($t)) { + $t = "HEAD"; + } + return $t; +}); + task('deploy:info', function () { $what = ''; $branch = get('branch'); diff --git a/recipe/deploy/release.php b/recipe/deploy/release.php index 33310e95..a330b557 100644 --- a/recipe/deploy/release.php +++ b/recipe/deploy/release.php @@ -123,7 +123,7 @@ task('deploy:release', function () { $date = run('date +"%Y%m%d%H%M%S"'); // Save metainfo about release - run("echo '$date,{{release_name}}' >> .dep/releases"); + run("echo '$date,{{release_name}},{{user}},{{git_target}}' >> .dep/releases"); // Make new release run("mkdir -p $releasePath"); diff --git a/recipe/deploy/status.php b/recipe/deploy/status.php new file mode 100644 index 00000000..79857412 --- /dev/null +++ b/recipe/deploy/status.php @@ -0,0 +1,29 @@ +format("Y-m-d H:i:s"); + if ($r[1] === $currentRelease) { + $r[1] = "$r[1]"; + } + } + + $table = new Table(output()); + $table + ->setHeaderTitle(currentHost()->getAlias()) + ->setHeaders(['Date', 'Release', 'Author', 'Target']) + ->setRows($metainfo); + $table->render(); +});