Skip to content
Snippets Groups Projects
Commit 7b763b95 authored by Jim MacArthur's avatar Jim MacArthur
Browse files

element.py: Switch to SandboxRemote if config option is set

parent b2a9027f
No related branches found
No related tags found
Loading
...@@ -2126,7 +2126,24 @@ class Element(Plugin): ...@@ -2126,7 +2126,24 @@ class Element(Plugin):
project = self._get_project() project = self._get_project()
platform = Platform.get_platform() platform = Platform.get_platform()
if directory is not None and os.path.exists(directory): if self.__remote_execution_url is not None and self.BST_VIRTUAL_DIRECTORY:
if not self.__artifacts.has_push_remotes(element=self):
# Give an early warning if remote execution will not work
raise ElementError("Artifact {} is configured to use remote execution but has no push remotes. "
.format(self.name) +
"The remote artifact server(s) may not be correctly configured or contactable.")
self.info("Using a remote 'sandbox' for artifact {}".format(self.name))
sandbox = SandboxRemote(context, project,
directory,
stdout=stdout,
stderr=stderr,
config=config,
server_url=self.__remote_execution_url,
allow_real_directory=False)
yield sandbox
elif directory is not None and os.path.exists(directory):
self.info("Using a local sandbox for artifact {}".format(self.name))
sandbox = platform.create_sandbox(context, project, sandbox = platform.create_sandbox(context, project,
directory, directory,
stdout=stdout, stdout=stdout,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment