Created
October 23, 2013 12:56
-
-
Save Koronen/7118176 to your computer and use it in GitHub Desktop.
Script to migrate Memcached provider from Couchbase to Memcachier on Heroku.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
if [ $# -lt 1 ]; then | |
echo "Usage: $0 APP" >&2 | |
exit 1 | |
fi | |
app="$1" | |
heroku addons:add memcachier --app $app | |
heroku addons:remove memcache --confirm $app --app $app | |
tempfile="`mktemp`" | |
heroku config --app $app > $tempfile | |
servers=`grep MEMCACHIER_SERVERS $tempfile | awk '{print $2}'` | |
username=`grep MEMCACHIER_USERNAME $tempfile | awk '{print $2}'` | |
password=`grep MEMCACHIER_PASSWORD $tempfile | awk '{print $2}'` | |
heroku config:set MEMCACHE_SERVERS=$servers MEMCACHE_USERNAME=$username MEMCACHE_PASSWORD=$password --app $app | |
rm "$tempfile" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment