4 # This script is used to make a Bacula docs 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.
16 base_pkg=bacula-$base_dir
20 echo "Need $0 <bacula-source-directory> <docs-source-directory> <remote-name> <branch>"
21 echo "e.g. $0 bacula-source docs-source bee master"
26 echo "Directory: $1 does not exist"
31 echo "Directory: $1 does not exist"
34 bcurrent=`git branch | awk '/*/ { print $2 }'`
35 git checkout ${branch}
37 echo "Checkout of branch ${branch} in $1/bacula failed."
40 git pull ${remote} ${branch}
45 echo "Directory: $2 does not exist"
50 echo "Directory: $2 does not exist"
53 current=`git branch | awk '/*/ { print $2 }'`
55 git checkout ${branch}
57 echo "Checkout of branch ${branch} in ${src} failed."
60 git pull ${remote} ${branch}
61 ver=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${bsrc}/src/version.h`
64 echo "Making $reltype for $base_pkg-$ver ..."
66 echo "OK? ctl-c to stop"
70 echo "Creating new tag -- $fulltag"
74 echo "Non-zero return status from Git"
78 echo "Create Tag $fulltag done"
80 rm -rf $base_pkg-$ver $base_pkg-$ver.tar.gz $base_pkg-$ver.tar.gz.sig
83 git archive --format=tar --prefix=$base_pkg-$ver/ $fulltag | gzip >${cwd}/$base_pkg-$ver.tar.gz
86 echo "Non-zero return status from Git"
90 echo "Exported release into ${cwd}/$base_pkg-$ver.tar.gz"
92 tar xfz $base_pkg-$ver.tar.gz
94 mv docs $base_pkg-$ver
96 ./configure --with-bacula=$bsrc
99 echo "Tarring docs ..."
100 tar cf $base_pkg-$ver.tar $base_pkg-$ver
101 rm -rf $base_pkg-$ver $base_pkg-$ver.tar.*
102 echo "bzip2 docs ..."
103 bzip2 $base_pkg-$ver.tar
104 ./sign $base_pkg-$ver.tar.bz2
105 ls -l $base_pkg-$ver.tar.*
107 if [ a$push != ano ]; then
109 git push ${remote} ${branch}
110 git push ${remote} tag ${fulltag}
111 echo "Pushed ${remote} and push tag ${fulltag}"
115 git checkout ${current}
118 git checkout ${bcurrent}