File: build_release.sh

package info (click to toggle)
xmlsec1 1.3.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,916 kB
  • sloc: ansic: 100,493; xml: 19,156; sh: 8,079; makefile: 1,186; javascript: 438; perl: 199
file content (93 lines) | stat: -rwxr-xr-x 3,017 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/sh
#
# Usage: build_release.sh <version> [<release-candidate-tag>]
#


# config
version=$1
rc=$2
cur_pwd=`pwd`
today=`date +%F-%H-%M-%S`

git_uri=git@github.com:lsh123/xmlsec.git
rpm_root=/usr/src/redhat
build_root="/tmp/xmlsec-build-area-$today"
tar_file="xmlsec1-$version.tar.gz"
sig_file="xmlsec1-$version.sig"
rc_tar_file="xmlsec1-$version-$rc.tar.gz"
rc_sig_file="xmlsec1-$version-$rc.sig"
git_release_branch=`echo "xmlsec-$version" | sed 's/\./_/g'`
git_version_tag=`echo $version | sed 's/\./_/g'`

if [ x"$version" = x ]; then
    echo "Usage: $0 <version> [<release-candidate-tag>]"
    exit 1
fi

echo "============== Creating build area $build_root for building xmlsec1-$version"
rm -rf "$build_root"
mkdir -p "$build_root"
cd "$build_root"

echo "============== Checking out the module '$git_url'"
git clone $git_uri
cd xmlsec
#if [ x"$rc" != x ]; then
#    echo "============== Switching to release branch '$git_release_branch' for RC build '$rc'"
#    git checkout $git_release_branch
#fi
find . -name ".git" | xargs rm -r

echo "============== Building xmlsec1-$version"
./autogen.sh --prefix=/usr --sysconfdir=/etc
make tar-release
# can't build rpm on ubuntu
# make rpm-release

echo "============== Moving tar file"
if [ x"$rc" = x ]; then
     mv "$tar_file" "$cur_pwd/"
else
     mv "$tar_file" "$cur_pwd/$rc_tar_file"
fi
cd "$cur_pwd"

echo "============== Signing tar file"
if [ x"$rc" = x ]; then
    gpg --output "$sig_file" --detach-sig "$tar_file"
else
    gpg --output "$rc_sig_file" --detach-sig "$rc_tar_file"
fi

if [ x"$rc" = x ]; then
     echo "============== Tagging the release $version in the github"
     echo "RUN MANUALLY: git tag -a "${version}" -m 'XMLSec release $version'"
     echo "RUN MANUALLY: git tag -a "xmlsec_$git_version_tag" -m 'XMLSec release $version'"
     echo "RUN MANUALLY: git push --follow-tags"
else
     echo "============== Tagging the release $version-$rc in the github"
     echo "RUN MANUALLY: git tag -a "${version}-$rc" -m 'XMLSec release $version-$rc'"
     echo "RUN MANUALLY: git tag -a "xmlsec_${git_version_tag}_$rc" -m 'XMLSec release $version-$rc'"
     echo "RUN MANUALLY: git push --follow-tags"
fi

echo "======== Publish release to website:"
if [ x"$rc" = x ]; then
    echo "RUN MANUALLY: scp $tar_file $sig_file smtp.aleksey.com:"
    echo "ssh to smtp.aleksey.com, run the ./bin/push-xmlsec-docs.sh $version"
    echo "then switch symlink for /home/apps/www/aleksey.com/xmlsec/current"
else
    echo "RUN MANUALLY: scp $rc_tar_file $rc_sig_file smtp.aleksey.com:"
    echo "ssh to smtp.aleksey.com, run the ./bin/push-xmlsec-docs.sh $version-$rc"
    echo "then switch symlink for /home/apps/www/aleksey.com/xmlsec/rc/"
fi

echo "========= Publish release to github:"
echo "Download release from website, go to github releases, use newly created tag and "
echo "tarball to publish release; after that create announcement about the release in the "
echo "github dicussions"


echo "============== Cleanup"
#rm -rf "$build_root"