Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rename a GoCD pipeline?

Tags:

go-cd

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...

like image 347
dokaspar Avatar asked Jun 19 '17 06:06

dokaspar


People also ask

How do I assign agents in GoCD pipeline?

Once the GoCD agent has been installed and pointed at your GoCD server, go to the Agents tab on the GoCD dashboard. You should see something like this: Note that the hostname is as reported by the agent, and the IP address is as reported by the server. To add the agent to the cloud, click “Enable”.

What is GoCD pipeline?

GoCD can store pipeline definitions in a source code repository (either in your application's repository, or in a separate repository). This way, you can keep your pipeline definitions out of GoCD and under version control, and manage them externally.

How do I use environment variables in GoCD?

You can add variables to an environment by editing the configuration of the environment. Click on the name of the environment to edit configuration. You specify variables on an environment in the Config XML by adding an < environmentvariables > section to the environment definition.


2 Answers

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.

like image 98
Jamie Avatar answered Jan 03 '23 11:01

Jamie


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",

          }'`
like image 20
yadayada Avatar answered Jan 03 '23 11:01

yadayada