Skip to end of metadata
Go to start of metadata
You are viewing documentation of TeamCity 4.x, which is not the most recent released version of TeamCity. Please refer to the listing to choose another version.
Search

Table of Contents

Administration > <build configuration> > Dependencies

Snapshot Dependencies

Setting the dependency by other build's sources you can ensure that a build will start only after the one it depends from is run and finished. TeamCity also checks if the builds use sources corresponding to the same moment of time. The dependency mechanism is the following:

  1. When a build is triggered (either manually or by one of the available triggers), the whole set of builds linked with the "sources dependencies" is retrieved, and all the builds are put into the build queue.
  2. When the first build within the set is ready to start, all the VCS roots of builds in the set are checked for changes, and discovered VCS revisions are set to the builds.
  3. The builds are started.
Icon

Each build can only start if all the builds it depends on are finished.

Add / Edit Snapshot Dependency



Option

Description

Depend on

Specify the build configuration that the current build configuration should depend on.

Options

This section allows to customize the following options of the dependency.

Do not run new build if there is a suitable one

If at the moment a build is started to run, a build of the configuration the current one depends on is already running with the same sources, TeamCity will take this already running build, instead of starting another one with the very same sources.

Only use successful builds from suitable ones

TeamCity will take already running build only if it is not failing or failed.

Run this build if dependency has failed

If enabled and dependency fails, the build of this build configuration will still be run.

Artifact Dependencies

If the build configuration contains artifact dependencies, the following information is presented for each dependency:

Option

Description

Artifacts source

The dependency in the following format:

Artifacts path

see description of the field below in the Add / Edit Artifact Dependency section

Destination path

see description of the field below in the Add / Edit Artifact Dependency section

Edit

Click this link to modify the selected dependency.

Delete

Click this link to remove the selected dependency.

Check dependencies

Click Check dependency button to verify newly added dependency. You need to provide valid user credentials to download artifacts from the server and perform the dependencies verification, since access to the artifacts requires authorization.

Save

Apply all changes.

Add / Edit Artifact Dependency




Option

Description

Add new dependency

Click this link to specify the artifact dependency.

Depend on

Specify the build configuration that the current build configuration should depend on.

Get artifacts from

Specify the type of build, from which the artifacts should be taken. The following options are available:

  • Last successful build
  • Last pinned build
  • Last finished build
  • Build number
    Icon
    • When selecting the build configuration, take your clean-up policy settings into account. Builds are cleaned and deleted on a regular basis, thus the build configuration could become dependent on a non-existent build. When artifacts are taken from a build with a specific number, then the specific build will not be deleted during clean-up.
    • If both dependency by sources and dependency by artifacts on a last finished build are configured for a build configuration, then artifacts will be taken from the build with the same sources.

Build number

Use this field to specify the exact build number of the artifact. This field is enabled, if the Build number option is selected in the Get artifacts from field.

Artifacts path

Specifies the files to be downloaded form the "source" build. The path should be relative to the artifacts directory of the "source" build. The path can either identify a specific file, or use wildcards to match multiple files. Ant-like wildcards are supported.
Downloaded artifacts will have the same directory structure as the source artifacts.
For example: use a/b/** to download all files from a/b directory of the source build. If there is a a/b/c/file.txt file in the source build artifacts, it will be downloaded into the file: DestinationPath/a/b/c/file.txt

Artifacts can also be extracted from zip/jar archives, using special '!' syntax:

The files matched inside the archive will be placed in the directory corresponding to the first directory with a wildcard in the name.
For example: release.zip!*.dll command will extract all .dll files residing in the root of release.zip artifact.

Examples of advanced usage:

  • release-*.zip!*.dll will extract *.dll from all archives matched release-*.zip pattern
  • a.zip!** will unpack entire archive saving path information
  • a.zip!a/b/c/**/*.dll will extract all .dll files from a/b/c and its subdirectories, into the destination directory, without a/b/c prefix

More artifacts

Click this link to open an additional text field, where you can specify the path to additional artifacts.

Destination path

Specify the destination path on the agent where downloaded artifacts should be placed. If the path is relative, it will be resolved against the build checkout directory. If needed, the destination path can be cleaned before downloading artifacts.

Clean directory before downloading artifacts

Check this option to delete the content of the destination directory before copying artifacts.

Ok

Preserve changes and close the page.




See Also: