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
buildstream
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
BuildStream
buildstream
Commits
94f64af5
Commit
94f64af5
authored
6 years ago
by
richardmaw-codethink
Browse files
Options
Downloads
Patches
Plain Diff
cli: Add artifact list-contents subcommand
parent
2ca28df6
No related branches found
No related tags found
1 merge request
!1008
WIP: Add artifact checkout, list, list-contents, delete and diff subcommands
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
buildstream/_frontend/cli.py
+31
-0
31 additions, 0 deletions
buildstream/_frontend/cli.py
with
31 additions
and
0 deletions
buildstream/_frontend/cli.py
+
31
−
0
View file @
94f64af5
...
...
@@ -1212,6 +1212,37 @@ def artifact_list(app, null, artifact_prefix):
end
=
sentinel
)
##########################################################################
# Artifact List Contents Command #
##########################################################################
@artifact.command
(
name
=
'
list-contents
'
,
short_help
=
"
List contents of artifacts
"
)
@click.option
(
'
--null
'
,
'
-z
'
,
default
=
False
,
is_flag
=
True
,
help
=
"
Separate tokens with NUL bytes instead of newlines
"
)
@click.argument
(
'
artifacts
'
,
type
=
click
.
Path
(),
nargs
=-
1
)
@click.pass_obj
def
artifact_list_contents
(
app
,
null
,
artifacts
):
"""
List the contents of artifacts
"""
sentinel
=
'
\0
'
if
null
else
'
\n
'
with
app
.
initialized
():
cache
=
app
.
context
.
artifactcache
elements
,
artifacts
=
_classify_artifacts
(
artifacts
,
cache
.
cas
,
app
.
project
.
directory
)
if
not
elements
and
not
artifacts
:
element
=
app
.
context
.
guess_element
()
if
element
is
not
None
:
elements
=
[
element
]
vdirs
=
_load_vdirs
(
app
,
elements
,
artifacts
)
for
vdir
in
vdirs
:
vdir
=
vdir
.
descend
([
"
files
"
])
print
(
sentinel
.
join
(
vdir
.
list_relative_paths
()),
end
=
sentinel
)
##################################################################
# DEPRECATED Commands #
##################################################################
...
...
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