Browse Source

add SITE_REPO_FETCH_METHOD=git option to fetch via git instead of http

Helge Jung 8 years ago
parent
commit
4452f8bb7e
1 changed files with 8 additions and 2 deletions
  1. 8 2
      build.sh

+ 8 - 2
build.sh

@@ -69,10 +69,16 @@ if [ ! -d "$CODE_DIR" ]; then
 	git clone https://github.com/freifunk-gluon/gluon.git "$CODE_DIR"
 fi
 
+if [ "_${SITE_REPO_FETCH_METHOD}" != "_git" ]; then
+    SITE_REPO_URL="https://git.c3pb.de/freifunk-pb/site-ffpb.git"
+else
+    SITE_REPO_URL="git@git.c3pb.de:freifunk-pb/site-ffpb.git"
+fi
+
 ### INIT /src/site IF NECESSARY
 if [ ! -d "$CODE_DIR/site" ]; then
-        info "Site repository does not exist, fetching it ..."
-	git clone https://git.c3pb.de/freifunk-pb/site-ffpb.git "$CODE_DIR/site"
+    info "Site repository does not exist, fetching it ..."
+    git clone "$SITE_REPO_URL" "$CODE_DIR/site" || abort "Failed to fetch SITE repository."
 fi
 
 ### CHECKOUT GLUON