]> git.sur5r.net Git - bacula/bacula/blob - bacula/release/makedocsrel
Fix bug #1988 -- pdfs not released
[bacula/bacula] / bacula / release / makedocsrel
1 #!/bin/sh
2 #
3 #
4 # This script is used to make a Bacula docs release
5 #   docs
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.
9 #
10 # Commit all changes, export the release, make a release tar.
11 #
12 # source ./config
13 . ./config
14
15 tagbase=Release-
16 base_dir=docs
17 base_pkg=bacula-$base_dir
18 remote=$3
19 branch=$4
20 ver=$5
21 fulltag=$tagbase$ver
22
23 if [ $# != 5 ] ; then
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"
26   exit 1
27 fi
28 cd $1
29 if [ $? -ne 0 ]; then
30    echo "Directory: $1 does not exist"
31    exit 1
32 fi
33 cd bacula
34 if [ $?  -ne 0 ]; then
35    echo "Directory: $1 does not exist"
36    exit 1
37 fi
38 bcurrent=`git branch | awk '/*/ { print $2 }'`
39 git checkout ${branch}
40 if [ $? -ne 0 ]; then
41    echo "Checkout of branch ${branch} in $1/bacula failed."
42    exit 1
43 fi
44 git pull ${remote} ${branch}
45 bsrc=`pwd` 
46 cd ${cwd}
47 cd $2
48 if [ $? -ne 0 ]; then
49    echo "Directory: $2 does not exist"
50    exit 1
51 fi
52 cd $base_dir
53 if [ $?  -ne 0 ]; then
54    echo "Directory: $2 does not exist"
55    exit 1
56 fi
57 current=`git branch | awk '/*/ { print $2 }'`
58 src=`pwd` 
59 git checkout ${branch}
60 if [ $? -ne 0 ]; then
61    echo "Checkout of branch ${branch} in ${src} failed."
62    exit 1
63 fi
64 git pull ${remote} ${branch}
65 echo " "
66 echo "Making $reltype for $base_pkg-$ver ..."
67 echo " "
68 #echo "OK?  ctl-c to stop"
69 #read a
70
71 git tag -d ${fulltag}  2>/dev/null 1>/dev/null
72 echo "Creating new tag -- $fulltag"
73 git tag $fulltag
74 if [ $? != 0 ] ; then
75   echo " "
76   echo "Non-zero return status from Git"
77   echo " "
78   exit 1
79 fi
80 echo "Create Tag $fulltag done"
81 cd ${cwd}
82 rm -rf $base_pkg-$ver $base_pkg-$ver.tar.gz $base_pkg-$ver.tar.gz.sig
83 rm -rf $fulltag
84 cd ${src}
85 git archive --format=tar --prefix=$base_pkg-$ver/ $fulltag | gzip >${cwd}/$base_pkg-$ver.tar.gz
86 if [ $? != 0 ] ; then
87   echo " "
88   echo "Non-zero return status from Git"
89   echo " "
90   exit 1
91 fi
92 echo "Exported release into ${cwd}/$base_pkg-$ver.tar.gz"
93 cd ${cwd}
94 tar xfz $base_pkg-$ver.tar.gz 
95 cd $base_pkg-$ver/
96 mv docs $base_pkg-$ver
97 cd $base_pkg-$ver
98 ./configure --with-bacula=$bsrc
99 make en
100 make mini-clean
101 cd ${cwd}
102 echo "Tarring docs ..."
103 tar cf $base_pkg-$ver.tar $base_pkg-$ver
104 rm -rf $base_pkg-$ver $base_pkg-$ver.tar.*
105 echo "bzip2 docs ..."
106 bzip2 $base_pkg-$ver.tar
107 ./sign $base_pkg-$ver.tar.bz2
108 ls -l $base_pkg-$ver.tar.*
109
110 if [ a$push != ano ]; then
111    cd ${src}
112    git push ${remote} ${branch}
113    git push ${remote} tag ${fulltag}
114    echo "Pushed ${remote} and push tag ${fulltag}"
115 fi
116
117 cd ${src}
118 git checkout ${current}
119
120 cd ${bsrc}
121 git checkout ${bcurrent}