Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bitia-cli
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bitia
bitia-cli
Merge requests
!19
Resolve "Add support for `artifacts` endpoint"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Add support for `artifacts` endpoint"
13-add-support-for-artifacts-api
into
main
Overview
1
Commits
5
Pipelines
8
Changes
1
Merged
Nitish Kumar
requested to merge
13-add-support-for-artifacts-api
into
main
2 years ago
Overview
1
Commits
5
Pipelines
8
Changes
1
Expand
Closes
#13 (closed)
0
0
Merge request reports
Compare
main
version 6
d2e1a989
2 years ago
version 5
536ba7d9
2 years ago
version 4
ca822752
2 years ago
version 3
924359a8
2 years ago
version 2
052b2bfe
2 years ago
version 1
7539ddbb
2 years ago
main (base)
and
latest version
latest version
d35f1120
5 commits,
2 years ago
version 6
d2e1a989
4 commits,
2 years ago
version 5
536ba7d9
4 commits,
2 years ago
version 4
ca822752
3 commits,
2 years ago
version 3
924359a8
3 commits,
2 years ago
version 2
052b2bfe
2 commits,
2 years ago
version 1
7539ddbb
1 commit,
2 years ago
1 file
+
29
−
3
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
bitia/__main__.py
+
29
−
3
Options
@@ -89,8 +89,9 @@ def create_remote_container(
@session
def
list_containers
(
user_input
):
"""
List the remote server associated with the pipeline.
"""
for
container
in
_list_remote_container
(
user_input
):
cprint
(
container
)
if
not
_list_remote_container
(
user_input
):
for
container
in
_list_remote_container
(
user_input
):
cprint
(
container
)
def
_list_remote_container
(
user_input
)
->
T
.
List
[
str
]:
@@ -104,10 +105,35 @@ def _list_remote_container(user_input) -> T.List[str]:
server
=
bconfig
.
get_server
(),
params
=
dict
(
pipeline_sha256
=
pipeline
.
checksum
),
)
res
.
raise_for_status
()
if
res
.
status_code
!=
200
:
return
[]
return
res
.
json
()[
"
containers
"
].
split
(
"
,
"
)
@app.command
(
"
artifacts
"
)
@session
def
get_generated_artifacts
(
user_input
):
# check if the containers for the corresponding pipeline exists
if
not
_list_remote_container
(
user_input
):
cprint
(
"
Artifacts for this pipeline doesn
'
t exist, please run the pipeline using `bitia run` first...
"
)
return
pipeline
=
bpipeline
.
user_input_to_pipeline
(
user_input
)
res
=
bhelper
.
get
(
endpoint
=
"
artifacts
"
,
server
=
bconfig
.
get_server
(),
params
=
dict
(
pipeline_sha256
=
pipeline
.
checksum
),
)
res
.
raise_for_status
()
path
=
res
.
_content
assert
path
is
not
None
path
=
path
.
decode
()[
1
:
-
1
].
rstrip
()
server
=
bconfig
.
get_server
().
rstrip
(
"
/
"
)
cprint
(
"
Directory is being served at:
"
)
cprint
(
f
"
{
server
}
/
{
path
}
"
)
@app.command
(
"
logs
"
)
@session
def
stream_log
(
user_input
):
Loading