문제

I have two branches in git: master and "deploy" (not the real name but good for this example. When I want to deploy things to the test server, I merge those changes into deploy branch and I want TC to automatically deploy them. So I have a Build and a Deploy config set up in TeamCity. Build is set up to build all branches, so commits in both branches trigger builds. I want to set up the Deploy config to run only after a successful Build, and only if that Build was against the deploy branch. I see that I can set up a Snapshot Dependency, which seems like what I want, but I can't figure out how to limit it to only that branch. I want to guarantee that the Deploy build runs against the same source as the Build for the deploy branch.

올바른 솔루션이 없습니다

다른 팁

You can limit your builds to the deploy branch via the the VCS Root configuration screen.

  1. Clear the Default branch field.
  2. Add the refs/heads/deploy branch to the Branch specification field.

TeamCity branch specification

In order to integrate this change with a build template, you can parameterize the Branch specification as %git.branch.specification%.

  • For branch builds, the value is set to refs/heads/*
  • For deploy builds, the value is set to refs/heads/deploy
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top