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

Get the job execution id when running a job #285

Closed
sinister3vil opened this issue Feb 9, 2020 · 4 comments · Fixed by #322
Closed

Get the job execution id when running a job #285

sinister3vil opened this issue Feb 9, 2020 · 4 comments · Fixed by #322

Comments

@sinister3vil
Copy link

Hello,

Is it possible to get the job execution id when running a job in a way that's scriptable, without needing to parse the output. Say, like an environment variable, so when the job ends jobExecId=1234 is accessible in the environment?

@gschueler
Copy link
Member

it's not possible to automatically export the environment variable. I can modify the rd run command to allow formatting the Execution info output similar to the rd executions info command. you can use that in combination with the RD_FORMAT=json or -% format option for better scripting

gschueler added a commit that referenced this issue Aug 11, 2020
Fix #285 rd run output supports -v and -% and RD_FORMAT when not using follow mode
@sinister3vil
Copy link
Author

sinister3vil commented Aug 14, 2020

Hello @gschueler

Is this released in 1.3.2?

[11:45]kntouskos@SIN3MINT:scripts> rd run --id 0c636a77-2ad2-4b7b-b93a-d7a7ea4d6488 -- -Input 172.29.1.43 -Type IPs -% "%id"
# Execution started
11988 running 2020-08-14T11:45:35+0300 - http://172.16.0.11:4440/project/xxx/execution/show/11988 job 0c636a77-2ad2-4b7b-b93a-d7a7ea4d6488 test-job

Am I missing something?

@gschueler
Copy link
Member

the -% needs to be placed before the -- i think, try this:

rd run --id 0c636a77-2ad2-4b7b-b93a-d7a7ea4d6488 -% "%id" -- -Input 172.29.1.43 -Type IPs

@sinister3vil
Copy link
Author

@gschueler

Yes, you are right. My bad.
Thanks for the fix.

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