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

* [feat] Add wait and bell flags for the console command #53

Merged
merged 4 commits into from
Jun 19, 2017

Conversation

lyz-code
Copy link
Contributor

I found myself pressing F5 sooo many times because our jenkins sucks, so I needed this feature.

Maybe you see it interesting too. I've seen there are no tests for the console command so I figured there was no need to add further tests.

Correct me if I'm wrong.

Thanks

@LD250
Copy link
Owner

LD250 commented Jun 13, 2017

Hello @lyz-code , thanks for the PR!

There might be several problems with --wait option.

  1. If there are no builds, --wait wont work (not so serious indeed).
  2. If build starts before you run jenkins console --wait you will stack in this command until next build starts.

The --bell option looks useful, but I think it should be done in other way. I am not sure that print('\a') will beep for everyone. What if just fire the message when console command is done?

Btw., will this chain do what you need?
jenkins start job_name && jenkins console -i && echo -e '\a'

@lyz-code
Copy link
Contributor Author

Hi @LD250, thanks for the quick answer.

About the --wait option:

  1. I can make a try/except for the no build problem
  2. I can add a test to see if the current build is older than let's say 10s

About the --bell option:

  • I want to be notified when the job starts, not when it ends. So I'm able to follow the process of the job in real time.
  • The print('\a') is the default way to trigger any terminal bell, do you know any other way to trigger it?

And finally that chain wont work for two reasons:

  • I don't trigger the jenkins jobs, they either get triggered through a git hook or through other jenkins jobs
  • I wan't to be notified at the start of the job, not at the end

Give me your insights and I'll get to the coding :)

Thanks

@LD250
Copy link
Owner

LD250 commented Jun 16, 2017

Hello @lyz-code ,

Maybe it is better to have a separate command in this case?
jenkins wait job_name

Then you can:
jenkins wait job_name && echo -e '\a' && jenkins console -i

I do not know why, but print('\a') does not work for me. So in my case I will do something like:

jenkins wait job_name && notify-send "build starts"

In this case anyone can have any notify he likes.

Will this approach work for you?

@lyz-code
Copy link
Contributor Author

@LD250 You are right I think your approach is cleaner :)

@LD250 LD250 merged commit b7a11bf into LD250:master Jun 19, 2017
@LD250
Copy link
Owner

LD250 commented Jun 19, 2017

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants