Is there any possible way to delete stage history in GoAgent?

562 views Asked by At

I am using GoCD for package deployment and I would like to know if there are any possible ways to delete the Stage History in GoAgent.

I am asking this because the stage label was increasing to some extent while we are testing the pipelines and because of this we could not get the exact count of automated deployment.

Can anyone let me know if I could remove all the stage history without causing any confusions to the process?

1

There are 1 answers

0
Gavin Miller On

I haven't stumbled across an official way to delete Stage History, but I have found a "manual" way to accomplish this.


You'll need to rename your pipeline to have your stage history disappear. Now you'll notice that if you go into your pipeline administration, the ability to rename a pipeline is not allowed. Example:

un-editable pipeline name

So to circumvent this, you can go into your config.xml found under the /go/admin/config_xml path. Here's an image of that area:

Config XML in GoCD

From there if you edit your pipeline and rename it, all of your Stage History will be deleted.

If you're okay with the new pipeline name you're done. If you want to return to the original name, you'll likely have to delete the previously named pipeline directories, otherwise your history may come back (I say "likely", because I've never gone back to the original name before, so this part is theoretical ;)

The original-named pipeline directories are going to be under the following directory paths:

  • <path-to-go>/go-server/artifacts/pipelines/<old-pipeline-name>/*
  • <path-to-go>/go-server/artifacts/cache/<old-pipeline-name>/*
  • <path-to-go>/go-server/db/shine/rdf-files/<old-pipeline-name>/*

You ought to be able to delete those, and then rename your pipeline again back to your original name (obviously take proper backups and test before you delete those.)