8282770: Set source date in jib profiles from buildId

Reviewed-by: erikj
This commit is contained in:
Magnus Ihse Bursie 2022-03-08 13:57:59 +00:00
parent 5fab27e1b8
commit c6d743fb92

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -258,7 +258,6 @@ var getJibProfilesCommon = function (input, data) {
common.release_profile_base = { common.release_profile_base = {
configure_args: [ configure_args: [
"--enable-reproducible-build", "--enable-reproducible-build",
"--with-source-date=current",
], ],
}; };
// Extra settings for debug profiles // Extra settings for debug profiles
@ -1447,6 +1446,14 @@ var versionArgs = function(input, common) {
} else { } else {
args = concat(args, "--with-version-opt=" + common.build_id); args = concat(args, "--with-version-opt=" + common.build_id);
} }
var sourceDate
if (input.build_id_data && input.build_id_data.creationTime) {
sourceDate = Math.floor(Date.parse(input.build_id_data.creationTime)/1000);
} else {
sourceDate = "current";
}
args = concat(args, "--with-source-date=" + sourceDate);
return args; return args;
} }