Artifact Dependency Issue in TeamCity 2024.07.3 with Composite Builds

Hello TeamCity Community,

We are using TeamCity version 2024.07.3 (build 160765) and encountering an issue with artifact dependencies in a composite build configuration.

Setup:

  • We have a test build configuration that generates a 7zip archive as an artifact.
  • This test build configuration is listed as a dependency in a composite build configuration.
  • We’ve set up an artifact dependency on this test build within the composite build configuration, with the following path specification:

    +:readme.zip!/test/* => FromTestBuild.zip

Problem:

We expected the specified artifacts from readme.zip to be extracted and made available in the composite build under the name FromTestBuild.zip. However, we are experiencing issues with this setup.

Question:

Has anyone encountered similar issues with artifact dependencies in TeamCity 2024.07.3? Are there specific settings or steps required to correctly pull artifacts from a dependent build in composite configurations? Any insights or troubleshooting tips would be greatly appreciated.

Thank you in advance!

0
6 comments
Hi,

Could you tell me what kind of issue you are experiencing? What error do you encounter and when?

Best regards,
Anton
0

Hi,

Thank you for your response!

In my investigations, I've found that either the entire zip archive from the test build is made available as an artifact in the composite build, or nothing at all. This inconsistency makes it challenging to retrieve the specific artifacts I need. Any insights on why this might be happening would be greatly appreciated!

Thanks again!

Here the code of the Test-Build:

Version latestPortable
package _Self.buildTypes

import jetbrains.buildServer.configs.kotlin.*
import jetbrains.buildServer.configs.kotlin.buildSteps.python

object BuildConfigTest : BuildType({
    name = "BuildConfig_Test"

    artifactRules = """
        ** => readme.7z
        ** => readme.zip
    """.trimIndent()

    params {
        param("VCSRoot.Test.TeamCity.Repo2", "master")
    }

    vcs {
        root(TestTeamCityRepo2)
    }

    steps {
        python {
            name = "Simple Python Step 1"
            id = "Simple_Python_Step"
            command = script {
                content = """print ("Hello")"""
            }
        }
        python {
            name = "Simple Python Step 2"
            id = "Simple_Python_Step_2"
            command = script {
                content = """print ("Hello")"""
            }
        }
    }
})

and the Composite-BuildConfig:

package _Self.buildTypes

import jetbrains.buildServer.configs.kotlin.*

object Composite : BuildType({
    name = "Composite"

    type = BuildTypeSettings.Type.COMPOSITE

    vcs {
        showDependenciesChanges = true
    }

    dependencies {
        dependency(BuildConfigTest) {
            snapshot {
                reuseBuilds = ReuseBuilds.NO
            }

            artifacts {
                cleanDestination = true
                artifactRules = "+:readme.zip!/test/**=>FromTestBuild"
            }
        }
    }
})

 

and a screenshot of the teamcity composite build artefacts:

0
Hi,

The following works for me, please check.
1. Artifacts publishing in Test-Build: the same as in your configuration (`** => readme.zip`).
2. Artifact dependency in composite build: `+:readme.zip!test/** => FromTestBuild`.
The result of resolving this dependency:
```
Directory of C:\TeamCity\buildAgent\work\896ccf8637afb7b\FromTestBuild
12:02:01  
12:02:01   30.10.2024  12:02    <DIR>          .
12:02:01   30.10.2024  11:57    <DIR>          ..
12:02:01   30.10.2024  11:49                 5 test1.txt
12:02:01   30.10.2024  11:49                 5 test2.txt
```
Note the slight difference in the artifact dependency rule in my settings. See https://www.jetbrains.com/help/teamcity/2024.07/artifact-dependencies.html#Artifacts+Rules for more details and examples.

Best regards,
Anton
0

thank you for your help, but also with your given configuration … same result (no artifacts).

0

Hi again,

I’ve investigated further and noticed the following:

When I set the build type of the Composite-Build to "Regular," I can add an artifact path directly in the General Settings, and everything works as expected. However, when I switch to a "Composite" build type, I can't find an option to specify an artifact path in the General Settings.

This makes me wonder: is using a composite build for this setup perhaps the wrong approach? Is there a recommended way to handle artifact paths specifically in composite builds, or should I reconsider using a composite build type here?

Thanks for any guidance!

0
Hi,

I see, thanks for the details.
If the problem is that you can't publish the artifacts from the composite build, then it's expected. The composite build configuration doesn't run on the build agent, it just aggregates the results of dependencies in one place. Please see https://www.jetbrains.com/help/teamcity/2024.07/composite-build-configuration.html.

I think you may be looking for deployment build configuration instead: https://www.jetbrains.com/help/teamcity/2024.07/deployment-build-configuration.html.

Regarding the artifact dependencies resolution, did the setup that I provided work for you?

Best regards,
Anton
0

Please sign in to leave a comment.