Running out of disk space

    If you don’t do anything about it, you’ll end up seeing the following error:

    Running out of Disk Space - 图2

    GoCD will stop scheduling new pipelines until you make more room, either by compressing large files, attaching a larger hard drive, or by deleting unused artifacts. You could also let GoCD manage artifact disk space by enabling auto purge of old artifacts.

    Specify artifact purge start and end limits

    1. Navigate to the Admin section on the GoCD dashboard.
    2. Navigate to the Pipeline Management sub-section
    3. Specify when GoCD should begin to purge artifacts in the first edit box.
    4. Specify when GoCD should stop purging artifacts in the second edit box.

    Never delete artifacts for a stage

    You must be logged in as an admin user to configure this step.

    You can disallow deletion of artifacts from a particular stage so that those artifacts are excluded during deletion. This option can be set in the stage editor for a pipeline. This option can be set for stages that are important so that artifacts for the stage are preserved.

    1. Navigate to the admin section on the GoCD dashboard.
    2. Navigate to the pipelines section and choose a pipeline to edit
    3. Navigate to the stage settings for the stage

    4.Check the box ‘Never Cleanup Artifacts’

    In many cases, the easiest thing to do is compress some of the larger artifacts that you won’t frequently have need for. For example, if you have a large log file named ‘test.log’ and you’re running GoCD server on a unix machine, the following script will gzip those files that haven’t been modified in the last 10 days

    Now, if you add this to a system , your server can compress large artifacts automatically.

    If compressing large artifacts is not giving you enough free space, another thing you can do is attach a larger disk drive to store artifacts. After the drive is attached to the system, we can easily change the location GoCD uses for it’s artifact repository.

    • Find the location of the GoCD configuration file
    • Navigate to the Admin > Config XML tab section Running out of Disk Space - 图5
    • The location of the configuration file is listed here
    • Install the new drive
    • Shut down GoCD server
    • Copy all files from the original artifact repository location to the new drive
    • Change the artifact repository location in the configuration file
    • Start up GoCD server and verify you still have access to old artifacts

    The directory structure of the artifact repository makes selecting which artifacts are safe to delete easier. The format is: