start a release-inventory.sh and install-cr.sh script
also clean up some other scripts and add docs
diff --git a/docs/DEPRECATED.md b/docs/DEPRECATED.md
new file mode 100644
index 0000000..3bf604d
--- /dev/null
+++ b/docs/DEPRECATED.md
@@ -0,0 +1,47 @@
+# Deprecated
+
+Per [this issue](https://github.com/apache/couchdb-helm/issues/62), we plan to move things in `./docs` here
+to GitHub releases and follow the helm community's guidance on
+release practices for helm charts.
+
+# Migration Path
+
+In order to migrate the old .tgz files, we:
+
+- Will find the latest commit that modified a .tgz
+- Sanity check that `Chart.yaml` represents the same version
+- Forego any further file consistency checks (this is best effort)
+- Presume that the git state matches what is in the .tgz at that time
+- Tag and release the given commit to GitHub Releases using [`chart-releaser`](https://github.com/helm/chart-releaser)
+
+## How To
+
+1. `cd docs` to move into this directory
+2. Install the `chart-releaser` binary (only one architecture defined)
+```bash
+cd docs
+./install-cr.sh
+```
+3. Build an inventory of what .tgz files exist in the directory
+```bash
+./get-inventory.sh
+```
+4. Sanity check that things look appropriate
+```bash
+./check-inventory.sh
+```
+5. Run the release dry-run
+```bash
+# ./release-inventory.sh {{ owner }}
+# i.e.
+./release-inventory.sh colearendt
+```
+6. Check that things look good, then run the actual release process
+```bash
+# ./release-inventory.sh {{ owner }} execute
+# (see docs for more info / other args)
+# i.e.
+./release-inventory.sh colearendt execute
+```
+
+NOTE: we have not done anything to sign chart packages here, though `chart-releaser` supports doing so.
diff --git a/docs/get-inventory.sh b/docs/get-inventory.sh
index 1edb659..2a94df1 100755
--- a/docs/get-inventory.sh
+++ b/docs/get-inventory.sh
@@ -9,6 +9,8 @@
# generate the list of backfill commits
# assuming that the commit that added the tarball also has the appropriate state committed to the repo
-for f in `ls . | grep -v '.*backfill.*' | grep -v '.*inventory.*' | grep -v '.*index.*'`; do echo $f: `git log --oneline -- $f | head -1` >> inventory.txt; done
+for f in `ls . | grep 'couchdb-.*\.tgz'`; do
+ echo $f: `git log --oneline -- $f | head -1` >> inventory.txt;
+done
echo '--> Done!'
diff --git a/docs/install-cr.sh b/docs/install-cr.sh
new file mode 100755
index 0000000..e24ced0
--- /dev/null
+++ b/docs/install-cr.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+
+os=$(uname -p)
+arch=$(uname -s)
+if [[ "${os}" == "arm" ]] && [[ "${arch}" == "Darwin" ]]; then
+ mkdir -p ./bin/cr-1.4.0/
+ curl -L https://github.com/helm/chart-releaser/releases/download/v1.4.0/chart-releaser_1.4.0_darwin_arm64.tar.gz | tar -xzvf - -C ./bin/cr-1.4.0/
+ ln -f -s $PWD/bin/cr-1.4.0/cr $PWD/bin/cr
+ echo "Installed successfully!"
+else
+ echo "ERROR: OS '${os}' and Architecture '${arch}' not defined"
+ echo "Visit https://github.com/helm/chart-releaser/releases to see releases"
+fi
diff --git a/docs/release-inventory.sh b/docs/release-inventory.sh
new file mode 100755
index 0000000..ec0cf0e
--- /dev/null
+++ b/docs/release-inventory.sh
@@ -0,0 +1,73 @@
+#!/usr/bin/env bash
+
+set -euxo pipefail
+
+# Example usage
+#
+#
+# $1 == owner - no default
+# $2 == "execute" makes the release fire!
+# $3 == GitHub auth token. Defaults to the value of $GITHUB_PAT
+# $4 == GitHub repository - defaults to "couchdb-helm"
+
+owner=${1:-}
+execute=${2:-}
+token=${3:-${GITHUB_PAT:-}}
+repo=${4:-couchdb-helm}
+chart_name=${5:-couchdb}
+
+if [[ -z "$owner" ]]; then
+ echo "Error: must provide 'owner' in first argument"
+ exit 1
+fi
+
+echo "Owner: $owner"
+echo "Execute?: $execute"
+
+IFS_OLD=$IFS
+trap 'IFS=$IFS_OLD' EXIT SIGINT
+IFS=$'\n'
+
+current_sha=$(git branch --show-current)
+res=$?
+if [[ $res -gt 0 ]]; then
+ current_sha=$(git rev-parse --short HEAD)
+fi;
+# clean up handler. This warns, but does help escape the loop on interrupt
+trap "git checkout $current_sha; exit 1" EXIT SIGINT
+
+inventory=$(cat inventory.txt)
+for line in ${inventory}; do
+ echo $line;
+ tarball=$(echo $line | cut -d: -f 1);
+ gitsha=$(echo $line | cut -d' ' -f 2);
+ cversion=${tarball/couchdb-/};
+ cversion=${cversion/.tgz/};
+ echo "--> Checking out '$gitsha' for chart version '$cversion'";
+
+ git checkout $gitsha;
+
+ long_sha=$(git rev-parse $gitsha)
+
+ read -n 1 -p "Pausing to check if this is ok. Press any key to continue: ";
+ echo ;
+ echo "--> Continuing...";
+ echo; echo;
+
+ if [[ "$execute" == "execute" ]] && [[ -n "$token" ]]; then
+ echo "--> Setting tag for release ${cversion} and sha ${gitsha}!"
+ git tag -f ${chart_name}-${cversion}
+ echo "--> Executing release!"
+ ./bin/cr package ../couchdb
+ ./bin/cr upload -c "$long_sha" --skip-existing -t "$token" -o $owner -r $repo
+ git push --tags --force
+ # clean the directory
+ rm .cr-release-packages/*
+ else
+ echo "--> 'execute' was not provided to the .sh invocation. Skipping..."
+ fi
+
+done
+
+git checkout $current_sha
+exit 0