diff options
Diffstat (limited to 'tools/run_tests/package_targets.py')
-rw-r--r-- | tools/run_tests/package_targets.py | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/tools/run_tests/package_targets.py b/tools/run_tests/package_targets.py index 5bc4b1c9c4..997bc57cc5 100644 --- a/tools/run_tests/package_targets.py +++ b/tools/run_tests/package_targets.py @@ -32,6 +32,26 @@ import jobset +def create_docker_jobspec(name, dockerfile_dir, shell_command, environ={}, + flake_retries=0, timeout_retries=0): + """Creates jobspec for a task running under docker.""" + environ = environ.copy() + environ['RUN_COMMAND'] = shell_command + + docker_args=[] + for k,v in environ.iteritems(): + docker_args += ['-e', '%s=%s' % (k, v)] + docker_env = {'DOCKERFILE_DIR': dockerfile_dir, + 'DOCKER_RUN_SCRIPT': 'tools/jenkins/docker_run.sh', + 'OUTPUT_DIR': 'artifacts'} + jobspec = jobset.JobSpec( + cmdline=['tools/jenkins/build_and_run_docker.sh'] + docker_args, + environ=docker_env, + shortname='build_package.%s' % (name), + timeout_seconds=30*60, + flake_retries=flake_retries, + timeout_retries=timeout_retries) + return jobspec def create_jobspec(name, cmdline, environ=None, cwd=None, shell=False, flake_retries=0, timeout_retries=0): @@ -67,7 +87,22 @@ class CSharpNugetTarget: def __str__(self): return self.name +class NodeNpmBinaryTarget: + """Builds Node NPM package and collects binaries""" + + def __init__(self): + self.name = 'node_npm_binary' + self.labels = ['package', 'node', 'linux'] + + def pre_build_jobspecs(self): + return [] + + def build_jobspec(self): + return create_docker_jobspec( + self.name, + 'tools/dockerfile/grpc_artifact_linux_x64', + 'tools/run_tests/build_package_node.sh') def targets(): """Gets list of supported targets""" - return [CSharpNugetTarget()] + return [CSharpNugetTarget(), NodeNpmBinaryTarget()] |