Basic Git integration with Google App Engine

So we at use Git a lot for the our productions. It's great.

One vital detail you need to know in App Engine development is what’s up there, … y'know, up in the cloud.

The solution is as obvious as it is useful and tedious to write, for your consideration: a script that updates App Engine from the current HEAD and bookmarks it in a branch named uploaded-<version>.


# updates appengine from current HEAD and puts tree in uploaded-<version>

VERSION="$(grep '^version: ' "$APP/app.yaml" | cut -c 10-)"

echo "Creating snapshot for $VERSION" >&2

TREE="$(git write-tree)"
COMMIT="$(git commit-tree $TREE -p HEAD <<COMMIT
Upload $VERSION to Google App Engine
echo "commit $COMMIT"
git branch -f "$BRANCH" "$COMMIT" || exit

exec "$PYTHON" "$APPENGINE/" update app "$@"

Posted by: DaveE §

Why do you use the low level git commands here instead of the porcelain commands?

could you have done:

COMMIT="$(git commit -m <<COMMIT

Upload $VERSION to Google App Engine



Is it because you don't want to commit the current index to your current branch? You only want to commit it to a new branch and push it?

2012-06-13 @ 16:55:49
Posted by: Ludvig Ericson §

Because a mere git commit won't necessarily commit, for example if there are no unstaged changes or otherwise. This script writes the current index and sets a branch to a commit pointing to that tree.

2012-06-13 @ 16:57:29

Comment the entry:

Name: (required, possibly pseudonym)
Remember me (cookie)

E-mail: (not required, never published, solely for me to reply to you in person)



RSS 2.0