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

Cannot get upload to trigger Jenkins #8

Open
henryborchers opened this issue Apr 20, 2018 · 5 comments
Open

Cannot get upload to trigger Jenkins #8

henryborchers opened this issue Apr 20, 2018 · 5 comments

Comments

@henryborchers
Copy link

I followed the directions here https://github.com/devpi/devpi-jenkins/blob/master/README.rst but it's not working for me.

I set the uploadtriggers_jenkins to my jenkins server on my devpi index on my local machine.
I created the multijob Freestyle project with the file parameter jobscript.py on the Jenkins server.

I tried uploading a python package to my index and it simply added it and didn't trigger Jenkins at all.

Is this project still working and being maintained?

@henryborchers
Copy link
Author

henryborchers commented Apr 20, 2018

Okay, I think I have a lead what is causing the trouble. In order to trigger Jenkins in my version (2.107.2), a build trigger must be toggled in the settings. However, you need to include an authentication token if you turn it on. According to the devpi logs, Jenkins is correctly triggered if I include the authentication token as part of the URL. However, jenkins does not accept the jobscript.py file then.

@fschulze
Copy link
Contributor

This plugin was created as part of devpi a long time ago. A lot has changed in Jenkins since then.

I guess it would make sense to support generic webhooks instead. That way the usage in Jenkins would be much more flexible. Maybe there is something better even.

It would be great to get your opinion on that and maybe help figuring out how to best do that, iow what info should be included on webhook invocation etc.

If you found something like how the authentication can be done that isn't in the README yet, then a PR to enhance that is also greatly appreciated.

@henryborchers
Copy link
Author

Good questions. I gotta say that when I learned about this project, devpi-jenkins, I got really excited because it combines me two favorite tools that make my job so much easier and better. Jenkins and DevPi.

You are absolutely right. Jenkins has changed a lot. But it's for the better. Jenkins now an amazingly mature and flexible piece of software that I keep finding new ways to use it to improve the quality of my output.

To be honest, I haven't done network or web programming so I really don't know much about webhooks but I can tell you a little bit more about how I can connect to it other tools that use the API. If that helps at all.

Otherwise, I'd like to help if I can. I write a lot of Groovy based Jenkinsfile pipeline DSL scripts. If that can help in anyway such as creating a more modern template to send to Jenkins, I'd be more than willing to help out there.

Big picture: The thing that I think that would this awesome for is to have an index option in DevPi that forces a Jenkins tests BEFORE adding them. If the tests failed, it rejects it from being added to the index. Then no bad package accidentally gets added. Right now. I try to do this by having my Jenkinsfile script push it to a special temp index for running tests and only if they pass move them into production. The pipeline script is supposed to clean up this index temp after it's done but it's flawed and it's can easily break so I end up having to clean up the temp DevPi index manually.

@henryborchers
Copy link
Author

My guess is that devpi-jenkins is a very low priority. It's a shame because Jenkins is such a perfect companion for DevPi. I'd love DevPi to trigger a Jenkins test when I upload new packages to my staging index.

@JonathanRRogers
Copy link

It would be good if devpi-jenkins had direct support for authentication. I observed that the plugin uses the Requests package, which looks for a .netrc file to configure HTTP BASIC authentication. I was able to generate an API token for my Jenkins user and put the user name and token as password into ~/.netrc. This approach works with Jenkins' current (2.235.4) token authentication system via HTTP BASIC auth. I have Jenkins configured to only allow authenticated users to do anything. The older "token" URL parameter isn't necessary.

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