How can i use Jenkins with Atlassian Stash?

CBergau picture CBergau · Sep 26, 2013 · Viewed 18.3k times · Source

I've just setup Jenkins and i have some Repositories in my Stash. I installed the "Git plugin" in jenkins. I can now enter the repository url but there is nothing to enter my credentials.

It's possible using

http://username:password@mydomain/xx/yy.git 

but that is something i dont want to do.

What else can i do to authenticate?

Answer

cmyers picture cmyers · Jan 11, 2014

I am the author of this stash plugin that might help you: https://github.com/palantir/stashbot

Taking selectively from the readme:

To work with Jenkins, you MUST install the following jenkins plugins first.

  • Jenkins GIT plugin
  • Post build task

Next, build and install the plugin using the plugin SDK (more details in the readme)

Next, the stash admin goes into the Stashbot Admin page and creates a jenkins server config - here you give it the URL, username/password, etc details of the jenkins server.

Next, for each repository a "Stashbot CI Admin" link shows up for repo admins. From there you can check the "enabled" checkbox and tell it what branches you want build (via a regex) and what command it should run to do the build (optionally verifies and publishes).

After this point, the remainder is completely self-service. Any repo admin can ask for their project to "have CI" by filling out that form, and the jobs will automatically be created in the jenkins server.

Hope that helps.