-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
A Policy Build pipeline (using chef export -a) will give a policy archive with a name based on PolicyName-RevisionId.tgz
. Publishing this as a build artifact leads to not knowing exactly what the policy archive is named in the artifact directory.
Previously I would do the following and (ab)use shell expansion to get the name of the policy archive (the only file in that directory):
steps:
- script: 'chef push-archive development $(Release.PrimaryArtifactSourceAlias)/$(Build.DefinitionName)/*.tgz'
It appears that shell expansion doesn't work in the execute component task just now. This is my workaround:
steps:
- script: 'mv $(Release.PrimaryArtifactSourceAlias)/$(Build.DefinitionName)/*.tgz $(Release.PrimaryArtifactSourceAlias)/$(Build.DefinitionName)/$(Build.DefinitionName).tgz'
displayName: 'Rename Policy Archive'
- task: chef-software.chef-preview.execute.component-preview@2
displayName: 'chef push-archive development'
inputs:
component: chef
arguments: 'push-archive development $(Release.PrimaryArtifactSourceAlias)/$(Build.DefinitionName)/$(Build.DefinitionName).tgz'
A couple other options would just be to rename the build artifact in the policy build pipeline before it's published, or read the policy lock JSON and pass the revision ID between pipelines.
Metadata
Metadata
Assignees
Labels
No labels