Skip to content

Instantly share code, notes, and snippets.

@twogood
Created August 22, 2013 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twogood/6307501 to your computer and use it in GitHub Desktop.
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!
#!/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