Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
buildgrid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
6
Snippets
Groups
Projects
Show more breadcrumbs
BuildGrid
buildgrid
Commits
f95735ab
Commit
f95735ab
authored
6 years ago
by
finnball
Browse files
Options
Downloads
Patches
Plain Diff
temp-directory bot now returns stderr, stdout and exit code to client.
parent
fb9cedd3
No related branches found
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
buildgrid/_app/bots/temp_directory.py
+15
-4
15 additions, 4 deletions
buildgrid/_app/bots/temp_directory.py
with
15 additions
and
4 deletions
buildgrid/_app/bots/temp_directory.py
+
15
−
4
View file @
f95735ab
...
@@ -74,14 +74,25 @@ def work_temp_directory(context, lease):
...
@@ -74,14 +74,25 @@ def work_temp_directory(context, lease):
process
=
subprocess
.
Popen
(
command_line
,
process
=
subprocess
.
Popen
(
command_line
,
cwd
=
working_directory
,
cwd
=
working_directory
,
universal_newlines
=
True
,
env
=
environment
,
env
=
environment
,
stdin
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
)
stdout
=
subprocess
.
PIPE
,
# TODO: Should return the stdout and stderr in the ActionResult.
stderr
=
subprocess
.
PIPE
)
process
.
communicate
()
stdout
,
stderr
=
process
.
communicate
()
returncode
=
process
.
returncode
action_result
=
remote_execution_pb2
.
ActionResult
()
action_result
=
remote_execution_pb2
.
ActionResult
()
# TODO: Upload to CAS or output RAW
# For now, just pass raw
# https://gitlab.com/BuildGrid/buildgrid/issues/90
action_result
.
stdout_raw
=
stdout
.
encode
()
action_result
.
stderr_raw
=
stderr
.
encode
()
action_result
.
exit_code
=
returncode
logger
.
debug
(
"
Command stderr: [{}]
"
.
format
(
stderr
.
encode
()))
logger
.
debug
(
"
Command stdout: [{}]
"
.
format
(
stdout
.
encode
()))
logger
.
debug
(
"
Command exit code: [{}]
"
.
format
(
returncode
))
with
upload
(
context
.
cas_channel
,
instance
=
instance_name
)
as
cas
:
with
upload
(
context
.
cas_channel
,
instance
=
instance_name
)
as
cas
:
for
output_path
in
command
.
output_files
:
for
output_path
in
command
.
output_files
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment