3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
6 # This script is used to make a Bacula docs release
8 # It writes in the current directory, so we recommend that you
9 # do not run it in the Bacula source or Git directory, but
10 # in a special release directory.
12 # Commit all changes, export the release, make a release tar.
19 base_pkg=bacula-$base_dir
26 echo "Need $0 <bacula-source-directory> <docs-source-directory> <remote-name> <branch> <version>"
27 echo "e.g. $0 bacula-source docs-source bee Branch-4.0 4.0.3"
32 echo "Directory: $1 does not exist"
37 echo "Directory: $1 does not exist"
40 bcurrent=`git branch | awk '/*/ { print $2 }'`
41 git checkout ${branch}
43 echo "Checkout of branch ${branch} in $1/bacula failed."
46 git pull ${remote} ${branch}
51 echo "Directory: $2 does not exist"
56 echo "Directory: $2 does not exist"
59 current=`git branch | awk '/*/ { print $2 }'`
61 git checkout ${branch}
63 echo "Checkout of branch ${branch} in ${src} failed."
66 git pull ${remote} ${branch}
68 echo "Making $reltype for $base_pkg-$ver ..."
70 #echo "OK? ctl-c to stop"
73 git tag -d ${fulltag} 2>/dev/null 1>/dev/null
74 echo "Creating new tag -- $fulltag"
78 echo "Non-zero return status from Git"
82 echo "Create Tag $fulltag done"
84 rm -rf $base_pkg-$ver $base_pkg-$ver.tar.gz $base_pkg-$ver.tar.gz.sig
87 git archive --format=tar --prefix=$base_pkg-$ver/ $fulltag | gzip >${cwd}/$base_pkg-$ver.tar.gz
90 echo "Non-zero return status from Git"
94 echo "Exported release into ${cwd}/$base_pkg-$ver.tar.gz"
96 tar xfz $base_pkg-$ver.tar.gz
98 mv docs $base_pkg-$ver
101 rm -rf home-page cvt.scr presentations send techlogs upload rss_web.php
105 echo "Tarring docs ..."
106 tar cf $base_pkg-$ver.tar $base_pkg-$ver
107 rm -rf $base_pkg-$ver $base_pkg-$ver.tar.*
108 echo "bzip2 docs ..."
109 bzip2 $base_pkg-$ver.tar
110 ./sign $base_pkg-$ver.tar.bz2
111 ls -l $base_pkg-$ver.tar.*
113 if [ a$push != ano ]; then
115 git push ${remote} ${branch}
116 git push ${remote} tag ${fulltag}
117 echo "Pushed ${remote} and push tag ${fulltag}"
121 git checkout ${current}
124 git checkout ${bcurrent}