-
Notifications
You must be signed in to change notification settings - Fork 0
/
package-release
executable file
·43 lines (29 loc) · 1.01 KB
/
package-release
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
#!/bin/bash
set -e
base_folder=$(dirname $0)
pushd ${base_folder} >/dev/null
if [ $# -ne 2 ];
then
echo "Usage: $(dirname $0) <version> <git-tag>"
echo
echo "Note that the git tag must be pushed to github before doing this."
exit 1
fi
VERSION="$1"
BASED_ON_TAG="$2"
d=`pwd`
cid1=`docker run -i -d -v ${d}:/q q-text-as-data-rpm-builder:0.1`
cid2=`docker run -i -d -v ${d}:/q q-text-as-data-deb-builder:0.1`
function kill_container {
tmp=`docker kill ${cid1} ${cid2}`
}
trap kill_container EXIT
rm -rvf ${base_folder}/packages
mkdir -p ${base_folder}/packages
sleep 1
gh release download $BASED_ON_TAG -p '*' -D ./packages/
chmod +x ./packages/*
docker exec -it ${cid1} /bin/bash -i -c "/q/dist/create-rpm ${VERSION} ${BASED_ON_TAG}"
docker cp ${cid1}:/q/dist/rpm_build_area/RPMS/x86_64/q-text-as-data-${VERSION}-1.el6.x86_64.rpm ${base_folder}/packages/q-text-as-data-${VERSION}-1.x86_64.rpm
docker exec -it ${cid2} /bin/bash -i -c "cd /q/packages && alien ./q-text-as-data-${VERSION}-1.x86_64.rpm"
find ./packages/ -ls