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.
15 base_pkg=bacula-rescue
22 echo "Need $0 <rescue-source-directory> <remote-name> <branch> <version>"
23 echo "e.g. $0 rescue-source bee Branch-4.0 4.0.1"
28 echo "Directory: $1 does not exist"
33 echo "Directory: $1 does not exist"
37 current=`git branch | awk '/*/ { print $2 }'`
39 git checkout ${branch}
41 echo "Checkout of branch ${branch} in ${src} failed."
44 git pull ${remote} ${branch}
47 echo "Making $reltype for $base_pkg-$ver ..."
49 echo "OK? ctl-c to stop"
53 echo "Creating new tag -- $fulltag"
57 echo "Non-zero return status from Git"
61 echo "Create Tag $fulltag done"
63 rm -rf $base_pkg-$ver $base_pkg-$ver.tar.gz $base_pkg-$ver.tar.gz.sig
66 git archive --format=tar --prefix=$base_pkg-$ver/ $fulltag | gzip >${cwd}/$base_pkg-$ver.tar.gz
69 echo "Non-zero return status from Git"
73 echo "Exported release into ${cwd}/$base_pkg-$ver.tar.gz"
74 if [ a$push != ano ]; then
76 git push ${remote} ${branch}
77 # git push ${remote} tag ${fulltag}
78 echo "Pushed ${remote}"
81 git checkout ${current}
84 ./sign $base_pkg-$ver.tar.gz
85 ls -l $base_pkg-$ver.tar.*