#!/bin/sh
rm -rf ferretdb
mkdir ferretdb
export GOPATH=`pwd`/ferretdb
git clone --depth 1 https://github.com/FerretDB/FerretDB $GOPATH/src/github.com/FerretDB/FerretDB
(cd $GOPATH/src/github.com/FerretDB/FerretDB
 go mod tidy
 go mod verify
 go generate -x
 # go get -v -d 
)
tar cf - --exclude .git ferretdb | xz -9 >ferretdb-`date '+%Y%m%d'`.tar.xz
rm -rf ferretdb
