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.
17 base_pkg=bacula-$base_dir
24 echo "Need $0 <bacula-source-directory> <docs-source-directory> <remote-name> <branch> <version>"
25 echo "e.g. $0 bacula-source docs-source bee Branch-4.0 4.0.3"
30 echo "Directory: $1 does not exist"
35 echo "Directory: $1 does not exist"
38 bcurrent=`git branch | awk '/*/ { print $2 }'`
39 git checkout ${branch}
41 echo "Checkout of branch ${branch} in $1/bacula failed."
44 git pull ${remote} ${branch}
49 echo "Directory: $2 does not exist"
54 echo "Directory: $2 does not exist"
57 current=`git branch | awk '/*/ { print $2 }'`
59 git checkout ${branch}
61 echo "Checkout of branch ${branch} in ${src} failed."
64 git pull ${remote} ${branch}
66 echo "Making $reltype for $base_pkg-$ver ..."
68 #echo "OK? ctl-c to stop"
71 git tag -d ${fulltag} 2>/dev/null 1>/dev/null
72 echo "Creating new tag -- $fulltag"
76 echo "Non-zero return status from Git"
80 echo "Create Tag $fulltag done"
82 rm -rf $base_pkg-$ver $base_pkg-$ver.tar.gz $base_pkg-$ver.tar.gz.sig
85 git archive --format=tar --prefix=$base_pkg-$ver/ $fulltag | gzip >${cwd}/$base_pkg-$ver.tar.gz
88 echo "Non-zero return status from Git"
92 echo "Exported release into ${cwd}/$base_pkg-$ver.tar.gz"
94 tar xfz $base_pkg-$ver.tar.gz
96 mv docs $base_pkg-$ver
98 ./configure --with-bacula=$bsrc
101 echo "Tarring docs ..."
102 tar cf $base_pkg-$ver.tar $base_pkg-$ver
103 rm -rf $base_pkg-$ver $base_pkg-$ver.tar.*
104 echo "bzip2 docs ..."
105 bzip2 $base_pkg-$ver.tar
106 ./sign $base_pkg-$ver.tar.bz2
107 ls -l $base_pkg-$ver.tar.*
109 if [ a$push != ano ]; then
111 git push ${remote} ${branch}
112 git push ${remote} tag ${fulltag}
113 echo "Pushed ${remote} and push tag ${fulltag}"
117 git checkout ${current}
120 git checkout ${bcurrent}