Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass a command and a job in parameter to lab ci view #257

Open
MartinDelille opened this issue Dec 4, 2018 · 2 comments
Open

pass a command and a job in parameter to lab ci view #257

MartinDelille opened this issue Dec 4, 2018 · 2 comments

Comments

@MartinDelille
Copy link
Contributor

MartinDelille commented Dec 4, 2018

What about adding a command and a job to lab ci?

Example: in my CI I have to job build and test. Let's say I want to trace the test job:

$ lab ci trace test

It would directly output the job trace and returning to the shell with a result of 0 or -1 if the job succeed or failed.

@zaquestion
Copy link
Owner

Few thoughts here:

  1. lab supports passing in the job to lab ci trace
$ lab ci trace --help
If a job is not specified the latest running job or last job in the pipeline is used

Usage:
  lab ci trace [remote [[branch:]job]] [flags]

Aliases:
  trace, logs

Flags:
  -h, --help   help for trace

From you command probably something like

lab ci trace origin master:test
  1. The syntax is attempting to emulate some syntax from git. On another CI related issue, I'm questioning the decision myself: Support download of CI-uploaded artifacts #232 (comment) copying that here

the idea with branch:job was to emulate how git lets do stuff like git checkout origin branch:file -- A simple extension would just be to keep the colons going lab ci artifacts origin master:myjob:path/to/my/file, but mostly I'm wonder why colon separate at all and just do lab ci artifacts [remote [ branch [ job [ path ]]]

  1. The idea of adjust the exit code for job pass/fail is appealing. I'm not sure the trace command is the best place for it. Since a failed exit code would still indicate lab ci trace successfully printed logs. But I think the feature makes a lot of since for lab ci wait lab ci wait #240

@bmeneg
Copy link
Collaborator

bmeneg commented Jun 22, 2021

IMHO the exit code of a command should reflect if it succeeded or not, and in the lab ci trace it shouldn't have any relation to the job failing or not. For it, you could use grep for grepping a successful message and then get the exit code of grep itself, which relates to "text found" or "text not found".

@MartinDelille, considering the command line mentioned by @zaquestion on his comment and the above statement, would that solve your concerns raised in this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants