Created
August 22, 2013 13:56
-
-
Save twogood/6307501 to your computer and use it in GitHub Desktop.
Download an OpenShift snapshot and update the repository with changes made on the server. Don't forget to push afterwards!
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/sh | |
set -e | |
set -x | |
cd `dirname $0` | |
DIR=`pwd` | |
NAME=`basename $DIR` | |
SNAPSHOT_TARBALL=`mktemp --tmpdir "$NAME-XXX.tar.gz"` | |
rhc snapshot-save -a "$NAME" --filepath "$SNAPSHOT_TARBALL" | |
tar --wildcards --strip-components=5 -xvf "$SNAPSHOT_TARBALL" './*/app-root/runtime/repo/php' | |
git add -A php | |
git commit -m "Updated from snapshot" | |
rm "$SNAPSHOT_TARBALL" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment