mendhak / teamcity-stash

TeamCity - Stash integration. Plugin for TeamCity which updates Stash with build statuses
https://code.mendhak.com/teamcity-stash/
54 stars 17 forks source link

This repo is no longer maintained, please fork it if you wish to continue developing or fixing features. From what I can tell, Bitbucket Server has been pretty much abandoned, so this plugin should continue working until it is End Of Life.


Logo

TeamCity Stash (Bitbucket Server) Integration

If you use TeamCity and Bitbucket Server, then this plugin is for you.

This build feature sends build status updates from TeamCity to Bitbucket Server. You can then see build statuses against commits.

Stash screenshot

Install

Download the .zip file and place it in the <TeamCity data directory>/plugins folder, then restart TeamCity.

Set-up

Under your build steps, click on Add Build Feature. It will appear in the dropdown list.

Build Feature

Simply enter your Stash server details and credentials to connect with. The plugin will now send build status updates to your Stash server.

Configuration

How it works

This is a TeamCity Build Feature built using the TeamCity Open API.

It listens for build statuses and posts them to the Atlassian Stash Build API.

License

GPL v2


Code setup

You will need IntelliJ IDEA as this project uses IDEA features to build artifacts.

You will also need to download and extract TeamCity which provides the required jars.

Open the project in Intellij IDEA, you should see a lot of unresolved references, this is normal.

Go to File | Settings | Path Variables and set the TeamCityDistribution variable, pointing it to your TeamCity location.

To build the project, click Build | Build Artifacts... and choose plugin-zip. The .zip is generated in /out/artifacts/plugin_zip.

Troubleshooting

If the plugin doesn't seem to be working, you can find plugin messages in the teamcity-server.log file under your TeamCity installation. (Example: /TeamCity/logs/teamcity-server.log) This usually gives you a good idea of why a call may have failed.

You can also look at Stash's atlassian-stash.log under STASH_HOME's log folder (Example: /Stash-Home/log/atlassian-stash.log) file to see what it did with the HTTP request sent by the plugin. In the log file, search for POST /rest/build-status as a starting point.