Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a post-receive script to allow bare repository to act as a proxy.

  • Loading branch information...
commit 06c262e92dbc876f965ca229ecefd1409df99deb 1 parent 2839107
@nviennot nviennot authored
Showing with 29 additions and 0 deletions.
  1. +21 −0 README
  2. +8 −0 post-receive
View
21 README
@@ -26,6 +26,27 @@ remotepath=/htdocs/staging
Each section corresponds to a git branch.
+----
+
+An additional script post-receive is provided to allow a central bare repository
+to act as a proxy between the git users and the ftp server.
+One advantage is that users do not get to know the ftp credentials (perfect for interns).
+This is how it would look:
+
+User1 --+ +--> FTP_staging
+ \ /
+User2 -----> Git bare repository -----> FTP_master
+ / \
+User3 --+ +--> FTP_dev
+
+This is how the setup looks like
+root@server:/path-to-repo/repo.git# ls
+HEAD ORIG_HEAD branches config description ftpdata hooks info objects packed-refs refs
+root@server:/path-to-repo/repo.git# ls hooks -l
+total 0
+lrwxrwxrwx 1 root root 29 Aug 19 17:17 post-receive -> /path-to-git-ftp/post-receive
+
+
License:
Permission is hereby granted, free of charge, to any person
View
8 post-receive
@@ -0,0 +1,8 @@
+#!/bin/bash
+while read line; do
+ BRANCH=`echo $line | cut -d / -f 3-`
+ if [[ `grep "^\[$BRANCH\]$" ftpdata` ]]; then
+ echo "Uploading $BRANCH..."
+ `dirname $0`/git-ftp.py -v -b $BRANCH
+ fi
+done
Please sign in to comment.
Something went wrong with that request. Please try again.