]> git.e2factory.org Git - e2factory.git/commitdiff
Generate git tarball of e2factory during release
authorTobias Ulmer <tu@emlix.com>
Wed, 25 Jul 2012 07:31:44 +0000 (09:31 +0200)
committerTobias Ulmer <tu@emlix.com>
Wed, 25 Jul 2012 07:31:44 +0000 (09:31 +0200)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
release.sh

index 45d458d0d42088996c417dec370c98f698821f61..fa3810390c8af5ce4a2476d9a0b79302452d4833 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -e
 
 #E=echo
 E=""
@@ -34,3 +34,20 @@ $E git commit -s -m "create next changelog entry" Changelog
 
 $E git archive --format=tar --prefix=$TAG/ refs/tags/$TAG |gzip >$TAG.tar.gz
 sha1sum $TAG.tar.gz >$TAG.tar.gz.sha1
+
+
+if [ -z "$TAG" ]; then
+       echo "TAG not set"
+       exit 1
+fi
+rm -rf "$TAG.git"
+git init --bare "$TAG.git"
+pushd "$TAG.git"
+git fetch .. tag "$TAG"
+ cp FETCH_HEAD HEAD # same effect as git reset --hard FETCH_HEAD
+git gc --aggressive --prune=now
+popd
+
+tar czf "$TAG.git.tar.gz" "$TAG.git"
+rm -rf "$TAG.git"
+sha1sum "$TAG.git.tar.gz" > "$TAG.git.tar.gz.sha1"