I have a post-receive shell script as such:
#!/bin/bash
TGZNAME=imprv`date +%s`.tar.gz
TGZPATH=/var/git_out/imprv/
TGZFULL=$TGZPATH$TGZNAME
S3BUCKET=my-s3-bucket
S3PATH=s3://$S3BUCKET/imprv/
git --work-tree=/var/git_out/imprv/imprv --git-dir=/path/to/repositories/imprv/imprv.git checkout -f
echo " - creating tar "$TGZNAME >> /tmp/post-receive.log
tar -cjf $TGZFULL -C /var/git_out/imprv/imprv .
echo " - tar.gz created "$TGZFULL >> /tmp/post-receive.log
echo " - Uploading "$TGZFULL" to bucket "$S3PATH$TGZNAME >> /tmp/post-receive.log
s3cmd put $TGZFULL $S3PATH$TGZNAME --mime-type="application/gzip" >> /tmp/post-receive.log
echo " - operation complete" >> /tmp/post-receive.log
Nothing ends up in my bucket, but the tar file is created, and if I manually enter the s3cmd put command it works fine.
I am tailing the log file, and everything seems to proceed just fine, it sits and waits for the compressed file to be created before moving off to the next echo statement, so it's not trying to put the file before the tar.gz file is created. Thanks in advance.