Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

New feature: repo:reset to entirely blow away repo and cache #1

Merged
merged 3 commits into from

2 participants

@nzoschke

Also, show progress on all curl uploads.

@lstoll lstoll merged commit ccae9a4 into heroku:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 3, 2012
  1. @lstoll

    Cleanup README

    lstoll authored
Commits on Mar 23, 2012
  1. @nzoschke

    write progress on upload

    nzoschke authored
  2. @nzoschke
This page is out of date. Refresh to see the latest.
Showing with 31 additions and 8 deletions.
  1. +14 −6 README.md
  2. +17 −2 lib/heroku/command/repo.rb
View
20 README.md
@@ -2,20 +2,28 @@
This plugin adds some commands to the heroku gem to interact with the app's repo
-## download
+## Installation
- heroku repo:download -a appname
+To install:
+
+ $ heroku plugins:install https://github.com/lstoll/heroku-repo.git
+
+## Commands
+
+### Download
+
+ $ heroku repo:download -a appname
This will download the applications repo as a tarball.
-## gc
+### gc
- heroku repo:gc -a appname
+ $ heroku repo:gc -a appname
This will run a `git gc --agressive` against the applications repo. This is done inside a run procress on the application itself.
-## purge_cache
+### purge_cache
- heroku repo:purge_cache -a appname
+ $ heroku repo:purge_cache -a appname
This will delete the contents of the build cache stored in the repository. This is done inside a run process on the application.
View
19 lib/heroku/command/repo.rb
@@ -22,7 +22,7 @@ def purge_cache
tar -zxf ../repo.tgz
rm -rf .cache/*
tar -zcf ../repack.tgz .
-curl --upload-file ../repack.tgz '#{repo_put_url}'
+curl -o /dev/null --upload-file ../repack.tgz '#{repo_put_url}'
exit
EOF
end
@@ -41,7 +41,7 @@ def gc
tar -zxf ../repo.tgz
git gc --aggressive
tar -zcf ../repack.tgz .
-curl --upload-file ../repack.tgz '#{repo_put_url}'
+curl -o /dev/null --upload-file ../repack.tgz '#{repo_put_url}'
exit
EOF
end
@@ -54,6 +54,21 @@ def download
system("curl -o #{app}-repo.tgz '#{repo_get_url}'")
end
+ # repo:reset
+ #
+ # Reset the repo and cache
+ def reset
+ run <<EOF
+set -e
+mkdir -p repo_tmp/unpack
+cd repo_tmp/unpack
+git init --bare .
+tar -zcf ../repack.tgz .
+curl -o /dev/null --upload-file ../repack.tgz '#{repo_put_url}'
+exit
+EOF
+ end
+
private
def release
Something went wrong with that request. Please try again.