Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.