forked from severalnines/s9s-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease-to-obs.sh
executable file
·45 lines (38 loc) · 1.12 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
#!/bin/bash
# a script to make the s9s-tools easily releasable
# Author: David Kedves <[email protected]>
REPONAME='home:kedazo/s9s-tools'
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 clean -dfx
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`"