Implement repo:gc and repo:purge-cache
These are helper plugins that mimic the repo plugin: https://github.com/heroku/heroku-repo The following commands will remain unimplemented: - `clone`: not useful for the host client to clone - `download`: currently not possible for us to "host" a tarball of the repo - `reset`: we still store files in the repo (though we shouldn't) so we cannot easily reinitialize the repository. Also fixes a potential race condition if two separate processes create an application's `$CACHE_DIR`. Closes #1570
This commit is contained in:
committed by
Michael Hobbs
parent
0c58aeaa52
commit
2c1f32199a
31
plugins/repo/commands
Executable file
31
plugins/repo/commands
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
[[ " help repo:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
case "$1" in
|
||||
help | repo:help)
|
||||
help_content_func () {
|
||||
declare desc="return repo plugin help content"
|
||||
cat<<help_content
|
||||
repo:gc <app>, Runs 'git gc --agressive' against the application's repo
|
||||
repo:purge-cache <app>, Deletes the contents of the build cache stored in the repository
|
||||
help_content
|
||||
}
|
||||
|
||||
if [[ $1 = "repo:help" ]] ; then
|
||||
echo -e 'Usage: dokku repo[:COMMAND]'
|
||||
echo ''
|
||||
echo "Runs commands that interact with the app's repo"
|
||||
echo ''
|
||||
echo 'Additional commands:'
|
||||
help_content_func | sort | column -c2 -t -s,
|
||||
else
|
||||
help_content_func
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||
;;
|
||||
|
||||
esac
|
||||
Reference in New Issue
Block a user