4 # This script is used to make a Bacula rescue release
6 # It writes in the current directory, so we recommend that you
7 # do not run it in the Bacula source or Git directory, but
8 # in a special release directory.
10 # Commit all changes, export the release, make a release tar.
17 base_pkg=bacula-rescue
24 echo "Need $0 <rescue-source-directory> <remote-name> <branch> <version>"
25 echo "e.g. $0 rescue-source bee Branch-4.0 4.0.1"
29 check_return_code "$0: Directory $1/rescue does not exist"
31 current=`git branch | awk '/*/ { print $2 }'`
33 git checkout ${branch}
34 check_return_code "$0: Checkout of branch ${branch} in ${src} failed."
36 git pull ${remote} ${branch}
39 echo "$0: Making $reltype for $base_pkg-$ver ..."
41 echo "OK? ctl-c to stop"
44 git tag -d ${fulltag} 2>/dev/null 1>/dev/null
45 echo "Creating new tag -- $fulltag"
47 check_return_code "$0: Non-zero return status from git tag"
48 echo "Create Tag $fulltag done"
50 rm -rf $base_pkg-$ver $base_pkg-$ver.tar.gz $base_pkg-$ver.tar.gz.sig
53 git archive --format=tar --prefix=$base_pkg-$ver/ $fulltag | gzip >${cwd}/$base_pkg-$ver.tar.gz
54 check_return_code "$0: Non-zero return status from Git"
55 echo "Exported release into ${cwd}/$base_pkg-$ver.tar.gz"
56 if [ a$push != ano ]; then
58 git push ${remote} ${branch}
59 # git push ${remote} tag ${fulltag}
60 echo "Pushed ${remote}"
63 git checkout ${current}
66 ./sign $base_pkg-$ver.tar.gz
67 ls -l $base_pkg-$ver.tar.*