From 7b569df8ea30794608eb20308c4ddb02786df0d5 Mon Sep 17 00:00:00 2001 From: Alan King Date: Tue, 14 Dec 2021 23:04:41 -0500 Subject: [PATCH] [irods/irods#6020] Add --build_directory option to build hook --- irods_consortium_continuous_integration_build_hook.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/irods_consortium_continuous_integration_build_hook.py b/irods_consortium_continuous_integration_build_hook.py index 1607192bc..4a2f709bf 100644 --- a/irods_consortium_continuous_integration_build_hook.py +++ b/irods_consortium_continuous_integration_build_hook.py @@ -65,11 +65,11 @@ def copy_output_packages(build_directory, output_root_directory): irods_python_ci_utilities.append_os_specific_directory(output_root_directory), lambda s:s.endswith(irods_python_ci_utilities.get_package_suffix())) -def main(output_root_directory, irods_packages_root_directory, externals_directory): +def main(build_directory, output_root_directory, irods_packages_root_directory, externals_directory): install_building_dependencies(externals_directory) if irods_packages_root_directory: irods_python_ci_utilities.install_irods_dev_and_runtime_packages(irods_packages_root_directory) - build_directory = tempfile.mkdtemp(prefix='irods_audit_plugin_build_directory') + build_directory = os.path.abspath(build_directory or tempfile.mkdtemp(prefix='irods_audit_plugin_build_directory')) irods_python_ci_utilities.subprocess_get_output(['cmake', os.path.dirname(os.path.realpath(__file__))], check_rc=True, cwd=build_directory) irods_python_ci_utilities.subprocess_get_output(['make', '-j', str(multiprocessing.cpu_count()), 'package'], check_rc=True, cwd=build_directory) if output_root_directory: @@ -77,9 +77,13 @@ def main(output_root_directory, irods_packages_root_directory, externals_directo if __name__ == '__main__': parser = optparse.OptionParser() + parser.add_option('--build_directory') parser.add_option('--output_root_directory') parser.add_option('--irods_packages_root_directory') parser.add_option('--externals_packages_directory') options, _ = parser.parse_args() - main(options.output_root_directory, options.irods_packages_root_directory, options.externals_packages_directory) + main(options.build_directory, + options.output_root_directory, + options.irods_packages_root_directory, + options.externals_packages_directory)