rpm and deb
This commit is contained in:
parent
d20903e260
commit
460b15d827
21
build.sh
21
build.sh
@ -3,6 +3,17 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
RELEASE_VERSION=
|
RELEASE_VERSION=
|
||||||
|
buildpath=
|
||||||
|
builddir=
|
||||||
|
|
||||||
|
function setuptree() {
|
||||||
|
mkdir -p $buildpath
|
||||||
|
rm -rf ${buildpath:?}/*
|
||||||
|
b=$( mktemp -d $buildpath/gh-ostXXXXXX ) || return 1
|
||||||
|
mkdir -p $b/gh-ost
|
||||||
|
mkdir -p $b/gh-ost/usr/bin
|
||||||
|
echo $b
|
||||||
|
}
|
||||||
|
|
||||||
function build {
|
function build {
|
||||||
osname=$1
|
osname=$1
|
||||||
@ -10,6 +21,9 @@ function build {
|
|||||||
GOOS=$3
|
GOOS=$3
|
||||||
GOARCH=$4
|
GOARCH=$4
|
||||||
|
|
||||||
|
builddir=$(setuptree)
|
||||||
|
|
||||||
|
|
||||||
if ! go version | egrep -q 'go(1[.]9|1[.]1[0-9])' ; then
|
if ! go version | egrep -q 'go(1[.]9|1[.]1[0-9])' ; then
|
||||||
echo "go version is too low. Must use 1.9 or above"
|
echo "go version is too low. Must use 1.9 or above"
|
||||||
exit 1
|
exit 1
|
||||||
@ -26,6 +40,13 @@ function build {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
(cd $buildpath && tar cfz ./gh-ost-binary-${osshort}-${timestamp}.tar.gz $target)
|
(cd $buildpath && tar cfz ./gh-ost-binary-${osshort}-${timestamp}.tar.gz $target)
|
||||||
|
|
||||||
|
if [ "$GOOS" == "linux" ] ; then
|
||||||
|
echo "Creating Distro full packages"
|
||||||
|
cp $buildpath/$target $builddir/gh-ost/usr/bin
|
||||||
|
fpm -v "${RELEASE_VERSION}" --epoch 1 -f -s dir -n gh-ost -m shlomi-noach --description "GitHub's Online Schema Migrations for MySQL " --url "https://github.com/github/gh-ost" --vendor "GitHub" --license "Apache 2.0" -C $builddir/gh-ost --prefix=/ -t rpm .
|
||||||
|
fpm -v "${RELEASE_VERSION}" --epoch 1 -f -s dir -n gh-ost -m shlomi-noach --description "GitHub's Online Schema Migrations for MySQL " --url "https://github.com/github/gh-ost" --vendor "GitHub" --license "Apache 2.0" -C $builddir/gh-ost --prefix=/ -t deb --deb-no-default-config-files .
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user