diff options
Diffstat (limited to 'buildscripts')
-rw-r--r-- | buildscripts/package_test_internal.py | 17 | ||||
-rwxr-xr-x | buildscripts/packager_enterprise.py | 7 |
2 files changed, 20 insertions, 4 deletions
diff --git a/buildscripts/package_test_internal.py b/buildscripts/package_test_internal.py index fa3e2ac0e70..b923a0e6f77 100644 --- a/buildscripts/package_test_internal.py +++ b/buildscripts/package_test_internal.py @@ -259,6 +259,23 @@ def get_test_args(package_manager: str, package_files: List[str]) -> TestArgs: def setup(test_args: TestArgs): logging.info("Setting up test environment.") + # TODO SERVER-70425: We can remove these once we have figured out why + # packager.py sometimes uses distro files from older revisions. + # Remove the PIDFile, PermissionsStartOnly, and Type configurations from + # the systemd service file because they are not needed for simple-type + # (non-forking) services and confuse the systemd emulator script. + run_and_log("sed -Ei '/^PIDFile=|PermissionsStartOnly=|Type=/d' {}/mongod.service".format( + test_args["systemd_units_dir"])) + # Ensure RuntimeDirectory has been added to the systemd unit file. + run_and_log("sed -Ei '/^ExecStart=.*/a RuntimeDirectory=mongodb' {}/mongod.service".format( + test_args["systemd_units_dir"])) + # Remove the journal: line (and the next) from mongod.conf, which is a + # removed configuration. The Debian version of the config never got updated. + run_and_log("sed -i '/journal:/,+1d' /etc/mongod.conf") + # Remove fork: and pidFilePath: from mongod.conf because we want mongod to be + # a non-forking service under systemd. + run_and_log("sed -Ei '/fork:|pidFilePath:/d' /etc/mongod.conf") + # Ensure systemd doesn't try to start anything automatically so we can do # it in our tests run_and_log("mkdir -p /run/systemd/system") diff --git a/buildscripts/packager_enterprise.py b/buildscripts/packager_enterprise.py index 25ceffc1dc2..ea89dc94633 100755 --- a/buildscripts/packager_enterprise.py +++ b/buildscripts/packager_enterprise.py @@ -28,6 +28,7 @@ # echo "Now put the dist gnupg signing keys in ~root/.gnupg" import errno +from glob import glob import os import re import shutil @@ -35,8 +36,6 @@ import sys import tempfile import time -from glob import glob - sys.path.append(os.getcwd()) import packager # pylint: disable=wrong-import-position @@ -255,8 +254,8 @@ def make_package(distro, build_os, arch, spec, srcdir): # FIXME: sh-dash-cee is bad. See if tarfile can do this. packager.sysassert([ "sh", "-c", - "(cd \"%s\" && GIT_HASH=$(git stash create) && git archive \"${GIT_HASH}\" %s/ )" - "| (cd \"%s\" && tar xvf -)" % (srcdir, pkgdir, sdir) + "(cd \"%s\" && git archive %s %s/ ) | (cd \"%s\" && tar xvf -)" % + (srcdir, spec.metadata_gitspec(), pkgdir, sdir) ]) # Splat the binaries under sdir. The "build" stages of the # packaging infrastructure will move the files to wherever they |