I am hoping that someone can help with the current issue that I am facing. Here is what I have...
I have recently set up a Stash, JIRA, TeamCity and Octopus Deploy Development Environment. In addition, we are trying to adopt the GitFlow methodology for branching. On the whole, things seems to be working the way that I would expect them to, with one exception.
First though, let me tell you what I have configured in TeamCity.
I have three build configurations.
The first is setup to trigger on every commit into a feature, release, or hotfix branch. That way, developers can work in "isolation" on a feature, and still get the benefit of Continuous Integration builds. In addition, we are using a TeamCity Plugin which reports the build status back to Stash.
The second is setup to trigger on every change to a pull request branch. We are using Pull Requests within Stash to accept all work from feature, release and hotfix branches.
The third is setup to trigger on any commits into develop or master branch, and has a snapshot dependency on the second build, and it is responsible only for the deployment of the artifacts to Octopus Deploy.
Does anyone see a problem with the above approach? I have been through a few iterations of the above, but to me, it seems to make sense.
The problem that I am having is to do with the following workflow...
- Raise an issue in JIRA, let's say GEP13
- Create a local branch in git called feature/GEP13, using current develop branch as base point
- Do the necessary work in this branch to implement the feature, lets say 3 commits worth
- Push the local branch to Stash
- Go into Stash UI and see that there is only 3 of commits in this branch, compared to develop
- Go to TeamCity and expect to see only 3 queued builds (i.e. one for every commit), since VCS Trigger is set up to trigger on every change
- Actually see that there are over 40 queued builds!!
TeamCity seems to be taking every change in the new feature/GEP13 branch since the start of the repository, and executing a build for each one?!? This really isn't what I would like. What I would like is obivously for TeamCity to only have three queued builds. Then assuming that the result of these builds are successful, I would then go into Stash and create a Pull Request from feature/GEP13 into develop, which would trigger the second build configuration. And assuming that went ok, and the Pull Request was approved, the work would be done to merge the Pull Request into develop, which would then trigger the third build configuration.
Can anyone suggest whether the problem is in my TeamCity configuration, or in Stash?
Do you require any further information in order to help out?