diff --git a/buildbot_nix/__init__.py b/buildbot_nix/__init__.py index 1d49d7e..97e0016 100644 --- a/buildbot_nix/__init__.py +++ b/buildbot_nix/__init__.py @@ -531,6 +531,14 @@ def nix_eval_config( For each evaluated attribute a new build pipeline is started. """ factory = util.BuildFactory() + + gerrit_private_key = None + with open(project.private_sshkey_path, 'r') as f: + gerrit_private_key = f.read() + + if gerrit_private_key is None: + raise RuntimeError('No gerrit private key to fetch the repositories') + # check out the source factory.addStep( steps.Gerrit( @@ -538,9 +546,10 @@ def nix_eval_config( mode="full", retry=[60, 60], timeout=3600, - sshPrivateKey=project.private_sshkey_path + sshPrivateKey=gerrit_private_key ), ) + # use one gcroots directory per worker. this should be scoped to the largest unique resource # in charge of builds (ie, buildnumber is too narrow) to not litter the system with permanent # gcroots in case of worker restarts. @@ -751,12 +760,6 @@ def config_for_project( ), ], ) - gerrit_private_key = None - with open(project.private_sshkey_path, 'r') as f: - gerrit_private_key = f.read() - - if gerrit_private_key is None: - raise RuntimeError('No gerrit private key to fetch the repositories') config["builders"].extend( [