0

I'm using AWS OpsWorks S3 deployment for quite some time. Suddenly the deployment fails. When I checked the instance, it turns out the disk is full. When I checked the release path inside the /srv/www/app/release/release_paths has a .git directory in it that turns out eats a lot of space.

I'm wondering why there is a .git directory in the release path when I use S3 deployment, not git deployment. Can I safely remove the .git directory on the deployment hook to free some space?

Petra Barus
  • 121
  • 1
  • 5

1 Answers1

0

I'd say it's not a good idea to outright delete them.

I'm wondering why there is a .git directory in the release path when I use S3 deployment, not git deployment.

The Chef deploy resource doesn't have an option to deploy from a zip (as oppose to from version control). To get around that OpsWorks downloads the zip and initializes a Git repository in it, then runs deploy on that.

When I checked the release path inside the /srv/www/app/release/release_paths

Did you mean releases/<some date> or shared/cached-copy? I don't think release is a standard directory in the default Chef deploy directory layout.

Can I safely remove the .git directory on the deployment hook to free some space?

If you mean releases/<some date> then no. This is used for the rollback command, allowing you to revert back to one of those previous versions.

If you really need the space the default number of versions to keep is 5, but you could reduce this by overriding the [:opsworks][:deploy_keep_releases] attribute.

thexacre
  • 1,849
  • 12
  • 14