Create a customized myers diff based system for snip content

This commit is contained in:
Tim
2025-04-14 23:25:11 +02:00
parent a18eda6748
commit 2db9c5f1d9
8 changed files with 317 additions and 88 deletions

27
deploy/git.php Normal file
View File

@ -0,0 +1,27 @@
<?php
namespace Deployer;
desc('Transfers information about current git commit to server');
task('deployment:log', function () { //https://stackoverflow.com/questions/59686270/how-to-log-deployments-in-deployer
$branch = parse('{{branch}}');
$date = date('Y-m-d H:i:s');
$commitHashShort = runLocally('git rev-parse --short HEAD');
// $commitHash = runLocally('git rev-parse HEAD');
$commit = explode(PHP_EOL, runLocally('git log -1 --pretty="%H%n%ci"'));
$commitHash = $commit[0];
$commitDate = $commit[1];
// $line = sprintf('%s %s branch="%s" hash="%s"', $date, $commitHashShort, $branch, $commitHash);
$array = [
'branch' => $branch,
'date' => $date,
'commitHashShort' => $commitHashShort,
'commitHashLong' => $commitHash,
'commitDate' => $commitDate,
];
$json = json_encode($array, JSON_PRETTY_PRINT);
runLocally("echo '$json' > release.json");
upload('release.json', '{{release_path}}/release.json');
});