From 5dd16e14dd41f1565687142ba7cefa7c4cf64658 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Tue, 12 Nov 2013 13:39:41 +0100 Subject: wip --- libexec/appstore-server-init | 50 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 libexec/appstore-server-init (limited to 'libexec/appstore-server-init') diff --git a/libexec/appstore-server-init b/libexec/appstore-server-init new file mode 100755 index 0000000..a220f83 --- /dev/null +++ b/libexec/appstore-server-init @@ -0,0 +1,50 @@ +#!/bin/bash + +set -e +set -u + +APPSTORE_HOME=$(cd $(dirname "$0")/.. && pwd) + +. $APPSTORE_HOME/lib/common +# HEADER END + +repos=$1; shift +appstores=$1; shift +name=$1; shift + +echo "Creating appstore: $name" + +repo="$repos/$name" +appstore="$appstores/$name" + +if [ -e "$repo" ] +then + echo "$name already exist!" + exit 1 +fi + +# Create the git repository +git init -q --bare "$repo" + +# Clone the repository +git init -q "$appstore" +cd "$appstore" + +# Copy the template project +cp -r "$APPSTORE_HOME/template/"* . +git add -A +git config user.name "Appstore Bot" +git config user.email nobody@example.org +git commit -q -m "Created new appstore: $name." +git push -q "$repo" master +cd .. + +# Install the hooks +cd "$repo" +rm hooks/* +rmdir hooks +ln -s "$APPSTORE_HOME/hooks" hooks +git config appstore.home "$APPSTORE_HOME" +git config appstore.apps "$appstore" + +echo "config: repo.path=$repo" -- cgit v1.2.3