зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1811114 - Trigger deb repackage on release-promotion action & nightlies r=jlorenzo,releng-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D167729
This commit is contained in:
Родитель
ff1fad1a73
Коммит
5400a96d1f
|
@ -1 +1 @@
|
|||
usr/lib/${DEB_PKG_NAME}/firefox usr/bin/firefox
|
||||
usr/lib/${DEB_PKG_NAME}/firefox usr/bin/firefox
|
|
@ -2232,16 +2232,32 @@ def repackage(command_context):
|
|||
@SubCommand(
|
||||
"repackage", "deb", description="Repackage a tar file into a .deb for Linux"
|
||||
)
|
||||
@CommandArgument("--input", "-i", type=str, required=True, help="Input filename")
|
||||
@CommandArgument("--output", "-o", type=str, required=True, help="Output filename")
|
||||
@CommandArgument(
|
||||
"--input", "-i", type=str, required=True, help="Input tarfile filename"
|
||||
)
|
||||
@CommandArgument("--output", "-o", type=str, required=True, help="Output .deb filename")
|
||||
@CommandArgument("--arch", type=str, required=True, help="One of ['x86', 'x86_64']")
|
||||
@CommandArgument(
|
||||
"--version",
|
||||
type=str,
|
||||
required=True,
|
||||
help="The Firefox version used to create the installer",
|
||||
)
|
||||
@CommandArgument(
|
||||
"--build-number",
|
||||
type=str,
|
||||
required=True,
|
||||
help="The release's build number",
|
||||
)
|
||||
@CommandArgument(
|
||||
"--templates",
|
||||
type=str,
|
||||
required=True,
|
||||
help="Location of the templates used to generate the debian/ directory files",
|
||||
)
|
||||
def repackage_deb(command_context, input, output, arch, templates):
|
||||
def repackage_deb(
|
||||
command_context, input, output, arch, version, build_number, templates
|
||||
):
|
||||
if not os.path.exists(input):
|
||||
print("Input file does not exist: %s" % input)
|
||||
return 1
|
||||
|
@ -2253,7 +2269,7 @@ def repackage_deb(command_context, input, output, arch, templates):
|
|||
|
||||
from mozbuild.repackaging.deb import repackage_deb
|
||||
|
||||
repackage_deb(input, output, template_dir, arch)
|
||||
repackage_deb(input, output, template_dir, arch, version, build_number)
|
||||
|
||||
|
||||
@SubCommand("repackage", "dmg", description="Repackage a tar file into a .dmg for OSX")
|
||||
|
|
|
@ -36,7 +36,7 @@ _DEB_ARCH = {
|
|||
_DEB_DIST = "jessie"
|
||||
|
||||
|
||||
def repackage_deb(infile, output, template_dir, arch):
|
||||
def repackage_deb(infile, output, template_dir, arch, version, build_number):
|
||||
|
||||
if not tarfile.is_tarfile(infile):
|
||||
raise Exception("Input file %s is not a valid tarfile." % infile)
|
||||
|
@ -58,16 +58,20 @@ def repackage_deb(infile, output, template_dir, arch):
|
|||
dict(section="App", value="CodeName", fallback="Name"),
|
||||
dict(section="App", value="Vendor"),
|
||||
dict(section="App", value="RemotingName"),
|
||||
dict(section="App", value="Version"),
|
||||
dict(section="App", value="BuildID"),
|
||||
)
|
||||
app_name = next(values)
|
||||
displayname = next(values)
|
||||
display_name = next(values)
|
||||
vendor = next(values)
|
||||
remotingname = next(values)
|
||||
version = next(values)
|
||||
buildid = next(values)
|
||||
timestamp = datetime.datetime.strptime(buildid, "%Y%m%d%H%M%S")
|
||||
remoting_name = next(values)
|
||||
build_id = next(values)
|
||||
timestamp = datetime.datetime.strptime(build_id, "%Y%m%d%H%M%S")
|
||||
if "a" in version:
|
||||
# We append the buildid to the alpha version to tell nightlies apart
|
||||
deb_pkg_version = f"{version}~{build_id}"
|
||||
else:
|
||||
# With other release flavors we opt for the release's build number
|
||||
deb_pkg_version = f"{version}~build{build_number}"
|
||||
|
||||
os.mkdir(mozpath.join(extract_dir, "debian"))
|
||||
shutil.copy(
|
||||
|
@ -75,9 +79,9 @@ def repackage_deb(infile, output, template_dir, arch):
|
|||
mozpath.join(extract_dir, "debian", "rules"),
|
||||
)
|
||||
defines = {
|
||||
"DEB_DESCRIPTION": f"{vendor} {displayname}",
|
||||
"DEB_PKG_NAME": remotingname.lower(),
|
||||
"DEB_PKG_VERSION": f"{version}.{buildid}",
|
||||
"DEB_DESCRIPTION": f"{vendor} {display_name}",
|
||||
"DEB_PKG_NAME": remoting_name.lower(),
|
||||
"DEB_PKG_VERSION": deb_pkg_version,
|
||||
"DEB_CHANGELOG_DATE": format_datetime(timestamp),
|
||||
}
|
||||
|
||||
|
|
|
@ -17,13 +17,16 @@ kind-dependencies:
|
|||
|
||||
only-for-build-platforms:
|
||||
- linux-shippable/opt
|
||||
- linux/opt
|
||||
- linux-devedition/opt
|
||||
- linux64-shippable/opt
|
||||
- linux64/opt
|
||||
- linux64-devedition/opt
|
||||
|
||||
only-for-attributes:
|
||||
- nightly
|
||||
- shippable
|
||||
|
||||
job-template:
|
||||
shipping-phase: promote
|
||||
worker-type: b-linux-gcp
|
||||
worker:
|
||||
docker-image:
|
||||
|
|
|
@ -239,6 +239,10 @@ PACKAGE_FORMATS = {
|
|||
"{architecture}",
|
||||
"--templates",
|
||||
"browser/installer/linux/debian",
|
||||
"--version",
|
||||
"{version_display}",
|
||||
"--build-number",
|
||||
"{build_number}",
|
||||
],
|
||||
"inputs": {
|
||||
"input": "target{archive_format}",
|
||||
|
@ -405,10 +409,11 @@ def make_job_description(config, jobs):
|
|||
attributes["repackage_type"] = "repackage-deb"
|
||||
description = (
|
||||
"Repackaging the '{build_platform}/{build_type}' "
|
||||
"build into a '.deb' package"
|
||||
"{version} build into a '.deb' package"
|
||||
).format(
|
||||
build_platform=attributes.get("build_platform"),
|
||||
build_type=attributes.get("build_type"),
|
||||
version=config.params["version"],
|
||||
)
|
||||
|
||||
_fetch_subst_locale = "en-US"
|
||||
|
@ -433,6 +438,7 @@ def make_job_description(config, jobs):
|
|||
"architecture": architecture(build_platform),
|
||||
"version_display": config.params["version"],
|
||||
"mar-channel-id": attributes["mar-channel-id"],
|
||||
"build_number": config.params["build_number"],
|
||||
}
|
||||
# Allow us to replace `args` as well, but specifying things expanded in mozharness
|
||||
# without breaking .format and without allowing unknown through.
|
||||
|
@ -551,6 +557,10 @@ def make_job_description(config, jobs):
|
|||
"linux64-mkbom",
|
||||
]
|
||||
)
|
||||
|
||||
if "shipping-phase" in job:
|
||||
task["shipping-phase"] = job["shipping-phase"]
|
||||
|
||||
yield task
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче