TeamCity trigger a build after a succesfull build on a generic branch name - teamcity

I have a TeamCity project :
Commit build
Another build
I want that if my commit build is successful on a generic branch name (if the branch name contains a specific word), another build start. The specific word is toto-ok in the example.
Example:
commit build on develop: do nothing more
commit build on branch feature/blabla-toto-ok-blabla: trigger
the other build
commit build on branch feature/something-else: do nothing more
commit build on branch feature/something-toto-ok-else:
trigger the other build

Related

Get branch name in build step

I am using Teamcity to build docker builds and I want to use the git branch in build steps. I create a build within a project, I then create a build step in that build to do a docker push and I set the image name:tag to registry:5000/myproject/%maven.project.artifactId%:%teamcity.build.branch%
When I run the build, it just queues and nothing happens. There is a message saying:
Implicit requirements: teamcity.build.branch defined in Build step: Docker push
How can I get the git branch so that I can use the branch name in the docker label:tag?

Is it possible to create a project from Git without 'master' branch?

I only have a develop branch in my repository at the moment.
When I try to create a project from it in Teamcity, I get the following error message:
Cannot find revision of the default branch 'refs/heads/master' of vcs root 'dummy VCS root (jetbrains.git)'
The question i:s how can I create a TeamCity build from repo without master branch? In Jenkins usually it makes no problem to build any branch
open attached VCS Roots of your project
Change Default branch to refs/heads/develop
Branch specification set to +:refs/heads/*
Now your default branch is develop, not a master.
Also, you able to see all branches because of the Branch specification

Change branch name when running custom build in Teamcity

Given I have Teamcity job with Git VCS root with default branch which can be changed with branch-name parameter:
When I e.g. set branch-name to develop in admin screen, go back to build configuration home and run custom build where I change branch-name parameter to master
then I get:
Why is that?
What should I change, so that I don't get this message and I can change branch when running custom build?
The reason for this is I want to build and deploy software artifacts from any feature branch
the Teamcity has an opportunity for monitoring the branches and runs built to custom branch.
Firstly, edit your VCS Root and add follows:
Default branch: refs/heads/master
Branch specification:+:refs/heads/*
now the TC will check changes by some interval.
We are sets the master as default branch. and when we run the build with default parameters, the build will start to master branch
If you are want to start build with custom branch then press Run... -> Changes -> select your custom branch from Build Branch parameter.
If you want to run build from API, or want to reverse the build branch parameter, just set Configuration parameters with key teamcity.build.branch
and value what you want

TeamCity feature branch artifact dependencies

I have a canary build (BuildA) in TeamCity (10.0.2) that builds master, develop, and all feature/* branches when commits occur.
I'd like to create another build (BuildB) that takes a small set of artifacts from BuildA, and runs FxCop on the files. And I want BuildB to have a Finish Build trigger, so that when BuildA completes for any branch, BuildB will get the artifacts from that branches build and run.
There seem to be some hurdles to setting this up:
When I open the "Edit Artifact Dependency" box, I have to specify a "Build branch", which is a logical branch name, not a wildcard or pattern match. So I don't know how to setup an artifact dependency on all builds coming out of BuildA.
The "Finish Build Trigger" has a branch filter, which looks like I can put "+:*" in to catch all branches, but how does that line up with the "Artifact Dependency" branch name value?
Why dont you just trigger BuildB, which in turn builds BuildA instead.
Then you can get artifacts from that specific build easily.

TeamCity trunk build is triggered by commit in a branch

I have a TeamCity setup with two projects building different svn branches from the same repository.
First project is for the trunk (stable), and other is for my development branch.
Whenever I commit something to my branch, trunk build is triggered.
Is that normal and can it be avoided?
I'm using TeamCity 6.0.
Marco, are you absolutely sure that your VCS settings for the trunk project do not include sources from the branch?
You configuration should be something like:
svn://server/root (VCS root)
trunk => . (checkout rules for trunk build)
branch/dev => . (checkout rules for branch build)
In this case, everything should work as expected.
Another thing - if your trunk and branch reference the same SVN external, and there is a change in this external, both builds will be triggered.
You can specify your trigger, e.g. the trigger pattern! Or you can write a custom build trigger :-).
Pattern for the trigger pattern :
+|-:[user][VCS root][path]

Resources