Pipeline expressions in artifact names


#1

Is it possible to use pipeline expressions in artifact names?

I’ve got a pipeline with an expected artifact like

  "matchArtifact": {
    "kind": "github",
    "name": "clusters/${parameters.clusterName}/manifests/foo.yaml",
    "type": "github/file"
  },

But when it runs I get an error:

“cancellationReason”: “Failed on startup: Illegal repetition near index 9\nclusters/${parameters.clusterName}/manifests/foo.yaml\n ^”,

I can tell ${parameters.clusterName} is a valid expression because it evaluates correctly when used elsewhere.


#2

As it stands now, when a pipeline is run the artifacts are resolved before the SpEL expressions are resolved: https://github.com/spinnaker/orca/blob/master/orca-web/src/main/groovy/com/netflix/spinnaker/orca/controllers/OperationsController.groovy#L94, so what you are attempting is not supported currently, but likely we should support. @ezimanyi Can you look into supporting SpEL resolution for the match artifacts in Triggers?