Skip to content

Commit 7bee7aa

Browse files
fix: allow specifying build timestamp
1 parent 75ce663 commit 7bee7aa

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/cmd.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export const cmd = new Command()
2424
.globalOption('--build-id <buildId:string>', 'Overide build ID')
2525
.globalEnv('RUNREAL_BUILD_PATH=<buildPath:string>', 'Overide path to build output folder', { prefix: 'RUNREAL_' })
2626
.globalOption('--build-path <buildPath:string>', 'Path to save build outputs')
27+
.globalEnv('RUNREAL_BUILD_TS=<buildTs:string>', 'Overide build timestamp', { prefix: 'RUNREAL_' })
28+
.globalOption('--build-ts <buildTs:string>', 'Overide build timestamp')
2729
.globalAction(async (options) => {
2830
// We load the config here so that the singleton should be instantiated before any command is run
2931
await Config.create({ path: options.configPath })

src/lib/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const defaultConfig = (): RunrealConfig => ({
3030
buildPipelineSlug: env('BUILDKITE_PIPELINE_SLUG') || '',
3131
},
3232
metadata: {
33-
ts: new Date().toISOString(),
33+
ts: env('RUNREAL_BUILD_TS') || new Date().toISOString(),
3434
safeRef: '',
3535
git: {
3636
branch: '',
@@ -252,7 +252,7 @@ export class Config {
252252
this.config.metadata = {
253253
...this.config.metadata,
254254
...metadata,
255-
ts: new Date().toISOString(),
255+
ts: env('RUNREAL_BUILD_TS') || new Date().toISOString(),
256256
}
257257

258258
const buildId = this.getBuildId()

0 commit comments

Comments
 (0)