Edit config repo pipeline via API?

19 views
Skip to first unread message

AquilaNiger

unread,
Aug 6, 2020, 5:07:27 AM8/6/20
to go-cd
Hi there, 

we have pipelines defined via config repositories and we have a ruby script triggering API calls on demand to reconfigure some parameters and environment variables. Can this even work with config repositories? I'm wondering now, because we are getting an error when editing some parameters via a call to https://api.gocd.org/current/#edit-pipeline-config. Our server is 20.2.0 currently and the call returns:

Something did not work, the pipelines may remain in partially wrong state: 422 Unprocessable Entity
Detail: {
"message" : "Can not operate on pipeline 'mypipeline' as it is defined remotely in 'https://<svn repo URL here> at 9580'."
}

Would be nice if some can give us an quick answer, before we spend to much time on a script which will not work this way anyways. Thanks in advance!

Regards
Julia

kritik...@thoughtworks.com

unread,
Aug 6, 2020, 5:14:25 AM8/6/20
to go-cd
Hi Julia,

No the pipeline config APIs for update/delete does not work for pipeline which comes from a config-repository. You will have to update your script to update the repo as needed.

Hope this helps.

Thanks
Kritika

Aravind SV

unread,
Aug 6, 2020, 5:24:38 AM8/6/20
to AquilaNiger, go-cd

we have pipelines defined via config repositories and we have a ruby script triggering API calls on demand to reconfigure some parameters and environment variables. Can this even work with config repositories? I’m wondering now, because we are getting an error when editing some parameters via a call to https://api.gocd.org/current/#edit-pipeline-config.

No, it’s not possible to edit pipelines defined outside of GoCD via the API. If that worked, then a subsequent restart of GoCD or even a new commit to the repository would overwrite your changes. The repository is the only source of truth for those pipelines.

It seems like the error message is quite self-explanatory.

AquilaNiger

unread,
Aug 6, 2020, 5:59:42 AM8/6/20
to go-cd
Thanks for the quick responses. I will try to work with updating the repo instead. 
Reply all
Reply to author
Forward
0 new messages