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
27f39c94
Commit
27f39c94
authored
6 years ago
by
Martin Blanchard
Browse files
Options
Downloads
Patches
Plain Diff
_app/commands: Move 'wait' from 'execute' to 'operation'
parent
6362346c
No related branches found
No related tags found
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
buildgrid/_app/commands/cmd_execute.py
+0
-14
0 additions, 14 deletions
buildgrid/_app/commands/cmd_execute.py
buildgrid/_app/commands/cmd_operation.py
+15
-1
15 additions, 1 deletion
buildgrid/_app/commands/cmd_operation.py
with
15 additions
and
15 deletions
buildgrid/_app/commands/cmd_execute.py
+
0
−
14
View file @
27f39c94
...
...
@@ -97,20 +97,6 @@ def request_dummy(context, number, wait_for_completion):
context
.
logger
.
info
(
next
(
response
))
@cli.command
(
'
wait
'
,
short_help
=
"
Streams an operation until it is complete.
"
)
@click.argument
(
'
operation-name
'
,
nargs
=
1
,
type
=
click
.
STRING
,
required
=
True
)
@pass_context
def
wait_execution
(
context
,
operation_name
):
stub
=
remote_execution_pb2_grpc
.
ExecutionStub
(
context
.
channel
)
request
=
remote_execution_pb2
.
WaitExecutionRequest
(
instance_name
=
context
.
instance_name
,
name
=
operation_name
)
response
=
stub
.
WaitExecution
(
request
)
for
stream
in
response
:
context
.
logger
.
info
(
stream
)
@cli.command
(
'
command
'
,
short_help
=
"
Send a command to be executed.
"
)
@click.option
(
'
--output-file
'
,
nargs
=
2
,
type
=
(
click
.
STRING
,
click
.
BOOL
),
multiple
=
True
,
help
=
"
Tuple of expected output file and is-executeable flag.
"
)
...
...
This diff is collapsed.
Click to expand it.
buildgrid/_app/commands/cmd_operation.py
+
15
−
1
View file @
27f39c94
...
...
@@ -32,7 +32,7 @@ from buildgrid._protos.google.longrunning import operations_pb2, operations_pb2_
from
..cli
import
pass_context
@click.group
(
name
=
'
operation
'
,
short_help
=
"
Long running operations commands
"
)
@click.group
(
name
=
'
operation
'
,
short_help
=
"
Long running operations commands
.
"
)
@click.option
(
'
--remote
'
,
type
=
click
.
STRING
,
default
=
'
http://localhost:50051
'
,
show_default
=
True
,
help
=
"
Remote execution server
'
s URL (port defaults to 50051 if no specified).
"
)
@click.option
(
'
--client-key
'
,
type
=
click
.
Path
(
exists
=
True
,
dir_okay
=
False
),
default
=
None
,
...
...
@@ -93,3 +93,17 @@ def lists(context):
for
op
in
response
.
operations
:
context
.
logger
.
info
(
op
)
@cli.command
(
'
wait
'
,
short_help
=
"
Streams an operation until it is complete.
"
)
@click.argument
(
'
operation-name
'
,
nargs
=
1
,
type
=
click
.
STRING
,
required
=
True
)
@pass_context
def
wait
(
context
,
operation_name
):
stub
=
remote_execution_pb2_grpc
.
ExecutionStub
(
context
.
channel
)
request
=
remote_execution_pb2
.
WaitExecutionRequest
(
instance_name
=
context
.
instance_name
,
name
=
operation_name
)
response
=
stub
.
WaitExecution
(
request
)
for
stream
in
response
:
context
.
logger
.
info
(
stream
)
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