dokaspar
dokaspar

Reputation: 8624

How to rename a GoCD pipeline?

It does not seem to be possible to change the name of an existing pipeline anywhere in GoCD. As simple as it sounds, is there any way to rename a GoCD pipeline that doesn't require a long series of actions in the UI?

The only way I was able to rename a pipeline is to clone it under a new name and then delete the old one. But deleting a pipeline also isn't straight-forward because is not possible to remove a pipeline that still belongs to some environment. Therefore, I first had to remove the pipeline from all environments and only then I was able to delete it.

There are some similar discussions about renaming pipelines here and there but since they are like five years old I thought a simple pipeline rename must somehow be supported in the meantime...

Upvotes: 5

Views: 2455

Answers (3)

Twinkle
Twinkle

Reputation: 11

First you'll have to un-link that pipeline from pipeline dependency and environment.

Then, you can go to 'Admin' > 'Config XML'and edit the name on XML file.

"Save" and You're good to go!

Upvotes: 1

yadayada
yadayada

Reputation: 357

You can use gocd api call https://api.gocd.org/17.3.0/#edit-pipeline-config and just

`$ curl 'https://ci.example.com/go/api/admin/pipelines/my_pipeline' \
      -u 'username:password' \
      -H 'Accept: application/vnd.go.cd.v3+json' \
      -H 'Content-Type: application/json' \
      -H 'If-Match: "e064ca0fe5d8a39602e19666454b8d77"' \
      -X PUT \
      -d '{
            "name": "my_pipeline",

          }'`

Upvotes: 1

Jamie
Jamie

Reputation: 306

You'll have to change the pipeline name inside the Config XML. To get there, go to: Admin -> Config XML. You'll need to change this in two places on the config.

Upvotes: 10

Related Questions