TrimbleSolutionsCorporation / TeamcityTriggerHook

Bitbucket Plugin to Trigger Builds in Teamcity
GNU Lesser General Public License v3.0
14 stars 15 forks source link

After merging a pull request two builds are triggered #44

Closed dzwicker closed 5 years ago

dzwicker commented 6 years ago

When merging a PR in bitbucket two builds are triggered on the teamcity server. The real strange thing about this is, both are marked as the branch the pr is merged to. But one build is the actual merge commit, the other one is the last commit from the PR branch.

This behavior starts after updating the hook plugin in bitbucket.

jmecosta commented 6 years ago

Hi

Can you export your configuration. And also your vcs roots configurations in teamcity and the build triggeres of the affected configurations

On Thu, 17 May 2018, 16:32 Daniel Zwicker, notifications@github.com wrote:

When merging a PR in bitbucket two builds are triggered on the teamcity server. The real strange thing about this is, both are marked as the branch the pr is merged to. But one build is the actual merge commit, the other one is the last commit from the PR branch.

This behavior starts after updating the hook plugin in bitbucket.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/TrimbleSolutionsCorporation/TeamcityTriggerHook/issues/44, or mute the thread https://github.com/notifications/unsubscribe-auth/AA_jyHc3Wb5HHzIW3u2ey3yBTPxPhbT2ks5tzXvxgaJpZM4UDEug .

dzwicker commented 6 years ago
{
    "8b8efe5b-50c6-XXXX-a01a-8050230de4f8": {
        "regex": "refs/heads/(.*)",
        "target": "XXXXX",
        "type": "vcs",
        "triggerOnEmptyBranches": true,
        "triggerOnPullRequest": false,
        "cancelRunningBuilds": false,
        "triggerInclusion": "",
        "triggerExclusion": "",
        "downStreamTriggerType": "build",
        "downStreamTriggerTarget": ""
    }
}
dzwicker commented 6 years ago
package it_betrieb_Docker_AuthadaDocker.vcsRoots

import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.vcs.GitVcsRoot

object it_betrieb_Docker_AuthadaDocker_AuthadaDocker : GitVcsRoot({
    uuid = "81029da8-f08b-XXXXXXX-a2ab-0aef6b05d48d"
    id = "it_betrieb_Docker_AuthadaDocker_AuthadaDocker"
    name = "Authada Docker"
    url = "ssh://git@XXXXX/itb/authada-docker.git"
    branchSpec = """
        +:refs/heads/(master)
        +:refs/heads/(feature/*)
        +:refs/heads/(bugfix/*)
        +:refs/heads/(hotfix/*)
        +:refs/heads/(release/*)
        +:refs/heads/(PR-*)
        +:refs/heads/(*)
    """.trimIndent()
    userForTags = "XXXXX"
    authMethod = uploadedKey {
        userName = "XXXX"
        uploadedKey = "XXXX"
        passphrase = "credentialsJSON:XXXXX-5e4de5ee1e02"
    }
})
dzwicker commented 6 years ago
triggers {
        vcs {
            perCheckinTriggering = true
            groupCheckinsByCommitter = true
        }
    }
dzwicker commented 6 years ago

all configurations are in the kotlin dsl, as exporting the projects don't produce any output for projects stored in vcs

dzwicker commented 5 years ago

Ok. I ahve removed the trigger from the teamcity build config. After this only one job is triggered for a PR-merge if the plugin uses build as trigger type.

jmecosta commented 5 years ago

ups sorry, yes if using build as trigger type you should get better results. the vcs means that you tell teamcity to check for changes so if you have somehting configured from that side it might not work as intended.