Passing parameters to `circleci config process`

Hello,

I’m trying to pass parameters in the circleci config process command line utility, however I’m getting the following error:

circleci config process .circleci/config_continue.yml --pipeline-parameters my-params.json
Error: config compilation request returned an error: invalid character 'I' looking for beginning of value

My JSON file looks like this:

{"parameters": {
    "app-deployment___w1": true,
    "app-deployment___app1": true,
    "app-deployment___app2": true,
    "app-deployment___app3": true,
    "app-deployment___app4": true,
    "app-deployment___app5": true,
    "app-deployment___app6": true,
    "app-deployment___app7": true,
    "app-deployment___app8": true,
    "maintenance-workflow": true,
    "db_schema_migration": true,
    "deploy___db": true
}
}

This problem seems to be related to the golang un-marshalls JSON, but can’t figure what kind of format it’s expecting, the help is rather explicit about the file type:

--pipeline-parameters string   YAML/JSON map of pipeline parameters, accepts either YAML/JSON directly or file path (for example: my-params.yml)

But there’s no example of the structure the file should have.

Any ideas?

This is a total guess, but you may want to try without the outer { and }

The logic is that the CLI is likely to just be building up the data structure used by the API call “Trigger a new pipeline”

Here the parameters are just part of the payload passed to the API call and the CLI maybe just injects the contents of your JSON file into the payload string.

Indeed this works:

thanks :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.