-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathrelease-to-obs.sh
executable file
·67 lines (55 loc) · 1.57 KB
/
release-to-obs.sh
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
#!/bin/bash
# a script to make the s9s-tools easily releasable
# Author: David Kedves <[email protected]>
if [ "${PUBLISHING_REPO}" == "TESTING" ]; then
REPONAME='home:severalnines/s9s-tools-testing'
else
REPONAME='home:severalnines/s9s-tools'
fi
echo "Comitting source files to OBS repository: ${REPONAME}"
CURRDIR=`pwd`
SRCDIR=${CURRDIR}/../build
if ! test -f .git/config; then
echo "You must start this script inside the s9s-tools source directory."
exit 1
fi
if command -v osc; then
echo "OSC `osc --version` is installed."
else
echo "OSC is not installed (apt-get install osc)."
exit 1
fi
echo "Cleaning up."
git reset --hard
git clean -dfx
git pull
if [ "${PUBLISHING_REPO}" == "TESTING" ]; then
./version-bump.sh
else
./version-bump.sh
if [ -f version.txt ]; then
git commit -a -m "Version bump"
git tag `cat version.txt`
git push origin master --tags
fi
fi
rm -rf ${SRCDIR}
mkdir -p ${SRCDIR}
cp -fva ${CURRDIR} ${SRCDIR}/s9s-tools-master
# remove old debian sources and binary files
echo "Building source packages for deb building."
cd ${SRCDIR}/s9s-tools-master
dpkg-buildpackage -rfakeroot -S
echo "Compressing sources for rpm building."
cd ${SRCDIR}
zip -r master.zip s9s-tools-master -xs9s-tools-master/.git/\* -x\*screenshots\*
cp -fva ${CURRDIR}/project.spec ${SRCDIR}
echo "Cleaning up for upload."
rm -rf ${SRCDIR}/s9s-tools-master
cd ${SRCDIR}
osc checkout "${REPONAME}"
rm -rfv ${REPONAME}/*.*
cp -fva ${SRCDIR}/*.* ${REPONAME}/
cd ${REPONAME}
osc addremove
osc commit --message="Release `date +%Y-%m-%d_%H%I`"