Fix release revision metadata for Deployer Git archives

This commit is contained in:
Mark Gregory
2026-11-20 09:52:47 +00:00
parent 969caf7d5c
commit 1761f92411
+22 -3
View File
@@ -286,10 +286,29 @@ task('absdev:laravel:prepare', function (): void {
desc('Write Git revision metadata'); desc('Write Git revision metadata');
task('absdev:revision', function (): void { task('absdev:revision', function (): void {
$revision = get('release_revision');
if (empty($revision)) {
throw new \RuntimeException(
'Deployer did not provide a Git revision.'
);
}
run( run(
'cd {{release_path}}' 'printf %s\\n '
. ' && git rev-parse HEAD > REVISION' . escapeshellarg($revision)
. ' && date -u +%Y-%m-%dT%H:%M:%SZ > DEPLOYED_AT' . ' > {{release_path}}/REVISION'
);
run(
'date -u +%Y-%m-%dT%H:%M:%SZ'
. ' > {{release_path}}/DEPLOYED_AT'
);
writeln(
'<info>Release revision: '
. $revision
. '</info>'
); );
}); });