Fix release revision metadata for Deployer Git archives
This commit is contained in:
+22
-3
@@ -286,10 +286,29 @@ task('absdev:laravel:prepare', function (): void {
|
||||
desc('Write Git revision metadata');
|
||||
|
||||
task('absdev:revision', function (): void {
|
||||
$revision = get('release_revision');
|
||||
|
||||
if (empty($revision)) {
|
||||
throw new \RuntimeException(
|
||||
'Deployer did not provide a Git revision.'
|
||||
);
|
||||
}
|
||||
|
||||
run(
|
||||
'cd {{release_path}}'
|
||||
. ' && git rev-parse HEAD > REVISION'
|
||||
. ' && date -u +%Y-%m-%dT%H:%M:%SZ > DEPLOYED_AT'
|
||||
'printf %s\\n '
|
||||
. escapeshellarg($revision)
|
||||
. ' > {{release_path}}/REVISION'
|
||||
);
|
||||
|
||||
run(
|
||||
'date -u +%Y-%m-%dT%H:%M:%SZ'
|
||||
. ' > {{release_path}}/DEPLOYED_AT'
|
||||
);
|
||||
|
||||
writeln(
|
||||
'<info>Release revision: '
|
||||
. $revision
|
||||
. '</info>'
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user