How to prevent TeamCity from storing build artifacts? - teamcity

TeamCity automatically stores files it believes are build artifacts. All of our artifacts are stored in Octopus Deploy, so this is unnecessary.
How do you configure TeamCity not to store build artifacts?

If you do not want to save artifacts, just remove Artifact paths from all projects
One more suggestion. Open Global Settings, sets Maximum build artifact file size to 0 Kb
Also, you can clean all the collected data
go to Administration > Server Administration > Clean-up Settings
The Previous clean-up section of the server clean-up settings enables you to:
review the information on the previous server clean-up date and duration helping you decide whether to launch the clean-up process at a given moment
run clean-up manually using the Start clean-up now button
During clean-up, TeamCity reports the progress. If you need, you can stop the clean-up process and the remaining data will be removed during the next clean-up.
Just press the button Start clean-up now

TeamCity doesn't store build artifacts by default.
Confirmed by Julia Reshetnikova in a support ticket:
What's happening is that a build step is pushing the artifacts using service messages. Configure the build steps to not push artifacts.
If the build steps do not allow configuring this, then the best thing you can do is configure a clean-up rule to remove build artifacts as fast as possible.
Go to the settings
Click on Clean-up Rules in the left navigation.
You may see multiple "build configuration or template", for each:
Click Edit.
Under "Clean Artifacts", choose custom policy.
Choose 1 days since last build or "1th" successful build, whichever makes the most sense to you.
All subprojects under will inherit this configuration. After this is configured, you can force TeamCity to run a cleanup by:
Go to the Administration page
Choose Clean-up Settings in the left navigation
Click "Start clean-up now"

Related

Teamcity snapshot dependency : how to prevent running the build which is already passed

Here's the scenario: I have a TeamCity "master" build that aggregates the results of other 11 builds.
I'm using snapshot dependencies.
This works fine in normal scenario.But in case, any of the dependent sub build fails and master build is triggered again then all 11 dependent builds get triggered.I want only failed build to be triggered not all.
Is there any way to achieve this??
In TC 8, some settings will interfere with build reusing. From the docs:
Some settings in VCS roots can effectively disable builds reusing.
These settings are:
Subversion: Checkout, but ignore changes mode
CVS: Checkout by tag mode
Perforce: Checkout by label set to Client instead of Client mapping
Starteam: checkout mode option set to view label or promotion date
(source: https://confluence.jetbrains.com/display/TCD8/Snapshot+Dependencies)
Normally, if the source code for any of the 11 dependent fields has not changes ,they will be queued but will just silently go to success
In case you just need artefacts from the previous builds, you can try setting up artefacts dependencies instead of snapshot dependencies. That way you can rerun an intermediate target if it fails and still continue for the rest of the chain. By the way if you are setting artefact dependencies you also have to add "Finish run triggers" on the targets
Also, when setting snapshot dependencies, there is an option "Do not run new if there is a suitable one". Please enable it to see if it solves your problem

How do I backup a build process in TeamCity?

How do I back up the build process (e.g. run this PowerShell script, run the build whenever a commit to VCS happens, not the build data) in TeamCity?
As an Adimistrator, log in, go the Administration page and look down the left side. Under Server Administration, toward the bottom of the list, is Backup. What is backed up varies by version. On mine (v8.1.1) the "Basic" setting says that the backup scope is (emphasis mine):
database
server settings, projects and builds configurations, plugins
supplementary data (settings history, triggers states, plugins data, etc.)

How to configure Teamcity to build a project which is a plugin of a different project?

I have a project which is a plugin for an opensource system. In order to run a CI build for the plugin, it needs to be installed into an existing instance of the main opensource system. I have mostly got this working, however, the install procedure for the main system is long and complex, so the build takes forever. It is also awkward to set up as checking out the plugin from git always happens first, whereas it needs to happen after the main system has been put in place so that the right directories are there. The solution I have right now is to use a shell script for the install and then an Ant task for the build, ignoring built-in VCS altogether. Feels hacky, though.
Two solutions come to mind:
Have a persistent install of the main system in the build directory, which the plugin is added to at the start of the build, and removed from at the end. I didi this ith Jenkins and it worked OK, but we are now using TeamCity.
Have some sort of parent-chid relationship between two CI projects, so that the main one is built and then triggers the plugin one, which is built within it. This would allow the main one to be rebuilt whenever it needs to be and avoids the awkwardness of keeping an install of the main system clean between builds.
However, I don't know enough about TeamCity to know if this is possible. Has anyone ever done something like this before?
For your solution number 2 you can try to use the "Build Triggers" configuration, the "Finish Build Trigger" option should resolve your parent-child relationship very well.
In TC, go to your plugin's build configuration, in "Configuration Steps" section select "Build Triggers" (number 5), then select "Add New Build Trigger" and configure "Finish Build Trigger" selecting your main system's build configuration.
To use parent directory in child one, you'll need to use the "Artifact Dependency" (see "Dependencies" section in "Configuration Steps", maybe setting some snapshots between the build configurations too.
Artifact Dependencies:
artifact Dependencies provide you with a convenient means to use the
output (artifacts) of one build in another build. When an artifact
dependency is configured, the necessary artifacts are downloaded to
the agent before the build starts.
Snapshot Dependencies: by setting a dependency of a build (e.g. build B) on other build's (build A's) sources, you can ensure that build B will start only after the one it depends on (build A) is run and finished
Configuring Finish Build Trigger:
finish build trigger triggers a build of current build configuration if a build of selected build configuration is finished

tagging built artifacts in Bamboo CI server

We are using bamboo as our integration server. During each build it produces binary packs of our products. Some of the built artifacts then goes in to QA.
Is there a way to retain build artifacts of a certain build job number, irrespective of the global build expire configuration. For an example, at some point we identify one of the built artifacts as release candidate.
The QA should be able to download that specific pack even after one weeks time. Right now we are copying the build artifacts from CI server to some other machine. It is a script, but still it is a manual process.
In Hudson there is an option called 'keep this build forever'.
Depending on your version this is possible by applying a label to it. Under a plan's configuration on the "Miscellaneous" tab, you can set a label which can then be used to prevent a build from expiring.
For example, our system has builds that can get labelled "SaveBuild" which then prevents their expiry.

How can I prevent TeamCity from creating artifacts for pre-tested commits?

Right now, TeamCity is creating 2 sets of artifacts each time I do a successful pre-tested commit, one when it builds the solution with my local changes against which to run the tests, and a second time when it gets triggered by the VCS repository change.
How can I prevent it from creating artifacts for its build-to-test before commit?
Check build.is.personal system property or BUILD_IS_PERSONAL environment variable to be defined.
Use a different build configuration for the VCS triggered build, one that doesn't have any paths configured for saving Artifacts.
Go to the Administration page and copy the existing build configuration.
Under "Build Triggering" on the original configuration, disable "Enable Triggering when files are checked into VCS"
Under "General Settings" on the copy remove everything from Artifact Paths

Resources