5

我正在从 Jenkins 转向使用Concourse CI来运行我的 Sauce labs e2e 测试。Sauce labs 将具有相同内部版本号字符串的测试组合在一起:

        name: 'Chrome XS',
        browserName: 'chrome',
        tunnelIdentifier: process.env.TUNNEL_IDENTIFIER,
        build: process.env.JENKINS_BUILD_NUMBER,
        platform: 'Windows 10',
        shardTestFiles: true,
        maxInstances: 20,

如何使用如上所示的环境变量将内部版本号传递给我的脚本。Concourse GUI 使用名称 #number。有没有办法找回这个。我尝试在 docker 容器中打印所有环境变量,但默认情况下未设置。

4

2 回答 2

3

故意不向任务提供内部版本号/ID 等元数据。见https://concourse-ci.org/implementing-resources.html#resource-metadata

这听起来像是 Sauce Labs 资源的潜在用例?

于 2016-09-29T16:04:36.147 回答
1

In Concourse, build metadata is only available for resources, not tasks.

An example on using build metadata with resources is to include it as part of build results notification emails. The following blog entry contains more information about it: http://lmpsilva.typepad.com/cilounge/2016/10/how-to-insert-build-metadata-into-user-notifications-in-concourse.html

If you really want to use build number for versioning, you could try to create your own Concourse resource that would return the version number, however, I would use your code commit number instead. Another alternative would be to use the Semver resource in Concourse: https://github.com/concourse/semver-resource

于 2016-12-02T19:26:55.357 回答