Skip to content

Commit

Permalink
[irods/irods#6020] Add --build_directory option to build hook
Browse files Browse the repository at this point in the history
  • Loading branch information
alanking authored and trel committed Dec 15, 2021
1 parent 7d72e74 commit 7b569df
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions irods_consortium_continuous_integration_build_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,25 @@ 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:
copy_output_packages(build_directory, output_root_directory)

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)

0 comments on commit 7b569df

Please sign in to comment.