Nathaniel D. Waggoner
Nathaniel D. Waggoner

Reputation: 2886

TeamCity: Configuring Multiple Build tasks to use the Same VCS download

Our CI needs to run tests on a number of environments.

Currently we have 8 tasks, each of which does a pull from the VCS, builds the artifact, and then runs the testing.

This is for Android testing on Emulators running various version of the Android OS.

I want to change this behavior so that we have the following structure:

1) Build Task

Does the VCS pull, builds the artifact for testing.

2) Test Task (1...n) -

Snapshot Dependency on Build Task Artifact.
Starts up the emulator for its version
Runs tests
Succeeds or fails.

The problem I'm having is that the build task appears to blow away the repository cloned from the VCS (we're using git) after its done. This means that the tier 2 tasks don't have access to the gradle wrapper which is in this repo.

Is there a way to stop the repo from being blown away between tasks so that I can reuse that location without doing a fresh clone for each task?

Upvotes: 3

Views: 370

Answers (2)

Dave Zych
Dave Zych

Reputation: 21897

Change the VCS checkout mode on the configuration from Automatically on server to Do not check out files automatically. In your root task, perform the checkout into a folder accessible by the other tasks. This way Teamcity won't touch the files and remove them at any point. You can then perform a cleanup yourself if you need to.

Upvotes: 2

Sam Holder
Sam Holder

Reputation: 32964

We had a similar problem using git with team city. If you need to do anything which is repository related on the agent then you have to do the checkout on the agent, which then ensures that the data is and the repo meta data is available on the agent machine.

As I recall TC will create a cache on the agents so that any future builds will only need to grab the deltas to get the updated repo so it might be slow the first time on each agent, but shouldn't need to do that same pull every time.

Upvotes: 0

Related Questions