My TeamCity's nightly build produces more than 130Mb java doc as Build Configuration artifact.
I have to share these artifact for other teams(developers), but javadoc every time has another one URL(I know that it's possible to get it like .lastFinished), and get's new place on Build Machine.
Is it possible on each build replace old artifact with new one because I don't need need previous versions? And have independent from build version URL for accessing.
You can configure TeamCity to delete artifacts after the n-th subsequent build - set this to 1, and it won't keep much for you. Look under Administration at Build History Clean-up Policy.
And the independent from build version URL should then probably be the .lastFinished one you mention.
Related
I am struggling a bit with the concept of azure pipelines and am looking for hints on how to solve the issue:
We have one Build definition that produces a binary artifact "Generator" in indeterminate intervals.
We have another build definition that should run every night, pull some source code from a repo, obtain the "Generator" artifact from the other build definition, execute it on the source and produce a new artifact.
The problem I have is, how can I get the latest build from the other build definition?
Here is a screenshot of my problem:
While I can select the proper build definition, the Build has to be an actual build. I cannot add "latest" here (tried and failed) but I don't really want to pin the build number.
Imagine the "Generator" to be something that gets updated once in a while and adds new features etc. The separate build definition at hand, which is not related to the build definition producing the "Generator" just wants to use the "latest" generator and to generate something from its own repository that can be published as an artifact afterwards.
I am pretty sure I am missing something and would be glad to get some hints. (Setting Current build instead of Specific build) actually does not allow me to select the project and build definition that is different from the current one.
Get latest artifact from Build Defintion X and use it to produce a new artifact
It seems the task Download Build Artifacts you are using is not the latest version, like 0.131.1. When I add this task (My version is 0.148.1), there is an option Build version to download that I could select the latest version:
So, try to remove it and add it again, check if you have that option.
Check this ticket for some more detail about this issue.
Besides, if you could not get the latest version, you can try to use the Fetch Build Artifacts task instead.
Ticket here.
Hope this helps.
Platform: Teamcity 8.1.4
We have a pipeline with stages that have several snapshot dependencies on other smaller builds. Our problem is that if any of these smaller builds fail then the pipeline that depends on these smaller builds chokes up and doesn't run until it is resolved.
This is certainly expected behaviour: we don't want breaking changes in the smaller pipelines to reach further down our main pipeline. However in our main pipeline we would rather use the Last Successful Build from each of the smaller pipelines instead of the Most Recent Build so the main pipeline isn't blocked and we can allow new successful changes to filter through from the other smaller pipes.
I've noticed that we can depend on the Last Successful Build if it was an Artifact Dependency instead of a Snapshot Dependency and they look on the surface to be very similar.
Questions
Are there downsides to using Artifact Dependencies instead of Snapshot Dependencies?
We need to pass through things like the Build Number and certain environment variables from the smaller pipelines to the main one - can we do this using Artifact Dependencies?
There are no downsides to using artefact dependencies. You woudl just need to fetch some artefacts. I ussualy fetch the build.finish.properties of the parent build
You can easily pass around all parameters (like build number , env variables etc) to artefact dependencies
You can use this syntax in the targets to get teamcity build finish properties
".teamcity/properties/build.finish.properties.gz"
I have set up a build step on TeamCity,as described here, to do automatic release deployments to our test server. But it is not using the latest nuget packages that was build in TeamCity.
Use Case :
Teamcity will create nuget package with version 1.0.0.9, all the dlls that is in the package is the correct version, and the Release in Octopus, that was deployed has got the same version number , but the packages that octopus uses is of an earlier package eg 1.0.0.5.
I have specified the --force parameter on the build step so it should use the latest packages but it is not.
If I manually create a release in Octopus, and select the latest packages it is working 100%
Please can someone tell me if I am missing something.
thanks in advance
I think what you need to do is create two build configurations in TeamCity, one to build and one to deploy with Octopus. Refer to this link that has a small blurb toward the end:
Note that NuGet packages created from your build won't appear in TeamCity until after the build completes. This means you'll usually need to configure a secondary build configuration, and use a snapshot dependency and build trigger in TeamCity to run the deployment build configuration after the first build configuration completes.
So in my case I created 2 build configurations, then setup a snapshot dependency from the build to the deploy config and also a trigger to kick off the deploy after a successful build.
It looks like --force is just to force packages to the be re-installed if they have already been installed. Are you using the --packageversion parameter?
My organization uses Jenkins CI. We use the unique build number as our package version and then deploy that specific package version using the --packageversion paramater.
In the case where we have multiple services that need to be deployed. We have an upstream job / main job that provides the unique build number.
I'd imagine you can do the same thing with TeamCity
Master Job (unique build number) calls jobs A and jobs B with parameter (unique build). Jobs A and B build version (from Master Job). Jobs A and B complete then publish their respective versions.
It could be a few things.
Check out.
http://octopusdeploy.com/documentation/integration/teamcity
You haven't mentioned how your consuming the feeds from Octopus in Teamcity. I would start there.
Next I would use the teamcity action to do your deploy. You asked "Where should the --waitfordeployment flag be added" there is a check box to make sure the deploy has worked before the action can continue.
In TeamCity I use a Octo Push Packages step and in the Additional Parameters field I specify the --defaultpackgeversion {VERSION} parameter.
This will force Octo to use a specific version of packages instead of just choosing the 'Latest Version'.
There are more possible reasons for the problem.
To see the problems with Octopus go to Configuration -> Diagnostics
Another common problem is to use a Package Name #{variable} in a deploy step
Currently it is not possible and Package Name should be set manually, for example MyWebSite or MyWindowsService. See UserVoice for this feature.
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.
We've just started to use TeamCity as a continuous integration server. There's a problem we're trying to solve now:
We have a 'release' configuration, it has build versions set like this: 1.0.0.{0}
We also have a 'nightly build' configuration, which build number is: 1.0.0.0.{build.vcs.number.1}
So the first 2 digits are OK, Major+Minor versions. Third one is supposed to be set up manually as well according to our process (rarely though).
But as you can see, the last one increases with every 'release'.
The question is - how do I make TC copy the current 4th digit (or all of them) of 'release' to that of 'nightly build'?
One way to do it in 4.5 is to
Make nightly have a snap shot dependency on release.
find the internal build id of release.
use a build number format in nightly that looks like
%dep.releaseid.system.build.number%.{build.vcs.number.1}
where releaseid is the id you found in step 2. This will replace the whole %...% thing with the build number from release.
The TeamCity 4.5 Docs for dependency properties explains this and shows you how to find the internal id.
If you can know it in your build script, you can send it to team city during the build. Here are the instructions. I can think of a couple of strategies for getting the build number from the release build, none of them elegant. The most obvious would be to publish an artifact from the release build that is basically a text file with the build number in it, and retrieve that from your build script.