Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
package support
Browse files Browse the repository at this point in the history
  • Loading branch information
tidwall committed Oct 19, 2016
1 parent 64a1240 commit 8e38b7d
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Change Log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [0.2.2] - 2016-10-17
### Added
- Added BACKUP command
- Added RAFTPEERS command
- Added FENCE command

2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ redis-cli:
cp src/redis-cli .. && \
cd .. && \
rm -rf redis-3.2.4
package:
@NOCOPY=1 ./build.sh package
30 changes: 30 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,36 @@ if [ "$NOCOPY" != "1" ]; then
cd $WD
fi

package(){
echo Packaging $1 Binary
bdir=summitdb-${VERSION}-$2-$3
rm -rf packages/$bdir && mkdir -p packages/$bdir
GOOS=$2 GOARCH=$3 ./build.sh
if [ "$2" == "windows" ]; then
mv summitdb-server packages/$bdir/summitdb-server.exe
else
mv summitdb-server packages/$bdir
fi
cp README.md packages/$bdir
cd packages
if [ "$2" == "linux" ]; then
tar -zcf $bdir.tar.gz $bdir
else
zip -r -q $bdir.zip $bdir
fi
rm -rf $bdir
cd ..
}

if [ "$1" == "package" ]; then
rm -rf packages/
package "Windows" "windows" "amd64"
package "Mac" "darwin" "amd64"
package "Linux" "linux" "amd64"
package "FreeBSD" "freebsd" "amd64"
exit
fi

# build and store objects into original directory.
go build -ldflags "-X main.version=$VERSION" -o "$OD/summitdb-server" cmd/summitdb-server/*.go

0 comments on commit 8e38b7d

Please sign in to comment.