How to generate YAML Specs for any-task configurations

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

The YAML Specs export does not show configuration maps for certain any-task plugin tasks from apps, such as the Generic Artifactory Deploy Task from the Artifactory for Bamboo app.

This article will use this task as an example.

Environment

This applies to Bamboo versions 7.2 and above, which have the any-task command in YAML.

Diagnosis

When the plan is exported as YAML Specs, the any-task command will show as:

1 2 3 - any-task: plugin-key: org.jfrog.bamboo.bamboo-artifactory-plugin:artifactoryGenericTask configuration: {}

Cause

The Specs exporter included in the Artifactory plugin does not include YAML configurations.

Solution

Export the plan as Java Specs and convert the Java to YAML

The Java Specs export will show the Task would export as:

Java Specs

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 new AnyTask(new AtlassianModule("org.jfrog.bamboo.bamboo-artifactory-plugin:artifactoryGenericTask")) .configuration(new MapBuilder() .put("artifactory.generic.publishBuildInfo", "") .put("artifactory.generic.username", "") .put("artifactory.generic.specSourceChoice", "file") .put("artifactory.task.buildNumber", "${bamboo.buildNumber}") .put("deployer.sharedCredentials", "Test") .put("deployer.overrideCredentialsChoice", "sharedCredentials") .put("artifactory.task.buildName", "${bamboo.buildPlanName}") .put("artifactory.generic.resolveRepo", "") .put("artifactory.generic.deployPattern", "argh") .put("artifactory.generic.envVarsExcludePatterns", "*password*,*secret*,*security*,*key*") .put("builder.artifactoryGenericBuilder.artifactoryServerId", "0") .put("artifactory.generic.file", "") .put("resolver.overrideCredentialsChoice", "") .put("artifactory.generic.useSpecsChoice", "legacyPatterns") .put("artifactory.generic.includeEnvVars", "true") .put("artifactory.generic.artifactSpecs", "") .put("artifactory.generic.password", "/* SENSITIVE INFORMATION */") .put("artifactory.generic.jobConfiguration", "{\n \"files\": [\n{\n \"pattern\":\".\", \n \"target\":\"/\"\n }\n ]\n}") .put("baseUrl", "http://bamboo:8085") .put("artifactory.generic.envVarsIncludePatterns", "") .put("artifactory.generic.resolvePattern", "") .put("builder.artifactoryGenericBuilder.deployableRepo", "blah") .put("captureBuildInfo", "true") .put("resolver.sharedCredentials", "") .put("buildInfoAggregation", "true") .build())))       

This could be converted to YAML as below. Any line that is not included will use the default.

YAML Specs

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 - any-task: plugin-key: org.jfrog.bamboo.bamboo-artifactory-plugin:artifactoryGenericTask configuration: artifactory.generic.publishBuildInfo: true artifactory.generic.specSourceChoice: jobConfiguration artifactory.task.buildNumber: ${bamboo.buildNumber}                               deployer.overrideCredentialsChoice: noOverriding artifactory.task.buildName: ${bamboo.buildPlanName} artifactory.task.envVarsExcludePatterns: "*password*,*secret*,*security*,*key*"                       builder.artifactoryGenericBuilder.artifactoryServerId: 0 artifactory.generic.useSpecsChoice: specs artifactory.generic.includeEnvVars: true artifactory.generic.jobConfiguration: |- { files: [ { pattern: ".", target: "/" } ] } baseUrl: http://bamboo:8085 captureBuildInfo: true buildInfoAggregation: true

Updated on March 24, 2025

Still need help?

The Atlassian Community is here for you.