Finish the build shell on linux.
This commit is contained in:
parent
81e14d12ea
commit
64406c3464
63
build/script/build.sh
Normal file
63
build/script/build.sh
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# if GOPATH not set
|
||||||
|
if [ -z "$GOPATH" ] ; then
|
||||||
|
echo "GOPATH not defined"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
PRE_DIR=$(pwd)
|
||||||
|
|
||||||
|
cd $GOPATH
|
||||||
|
|
||||||
|
echo "golang.org . Please download from: https://github.com/MXi4oyu/golang.org and put in the directory with same level of github.com"
|
||||||
|
# echo "go get golang.org/x"
|
||||||
|
# go get golang.org/x
|
||||||
|
|
||||||
|
# resize image
|
||||||
|
echo "go get github.com/disintegration/imaging"
|
||||||
|
go get github.com/disintegration/imaging
|
||||||
|
|
||||||
|
# json parser
|
||||||
|
echo "go get github.com/json-iterator/go"
|
||||||
|
go get github.com/json-iterator/go
|
||||||
|
|
||||||
|
# mysql
|
||||||
|
echo "go get github.com/go-sql-driver/mysql"
|
||||||
|
go get github.com/go-sql-driver/mysql
|
||||||
|
|
||||||
|
# dao database
|
||||||
|
echo "go get github.com/jinzhu/gorm"
|
||||||
|
go get github.com/jinzhu/gorm
|
||||||
|
|
||||||
|
# uuid
|
||||||
|
echo "go get github.com/nu7hatch/gouuid"
|
||||||
|
go get github.com/nu7hatch/gouuid
|
||||||
|
|
||||||
|
echo "build tank ..."
|
||||||
|
go install tank
|
||||||
|
|
||||||
|
echo "packaging..."
|
||||||
|
distPath="$GOPATH\src\tank\dist"
|
||||||
|
|
||||||
|
|
||||||
|
# if a directory
|
||||||
|
if [ ! -d $distPath ] ; then
|
||||||
|
echo "clear $distPath"
|
||||||
|
rm -rf $distPath
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "create directory $distPath"
|
||||||
|
mkdir $distPath
|
||||||
|
|
||||||
|
echo "copying cmd tank"
|
||||||
|
cp "$GOPATH/bin/tank" $distPath
|
||||||
|
|
||||||
|
echo "copying build"
|
||||||
|
cp -r "$GOPATH/src/tank/build" $distPath /e/h
|
||||||
|
|
||||||
|
cd $PRE_DIR
|
||||||
|
|
||||||
|
echo "check the dist file in $distPath"
|
||||||
|
echo "finish!"
|
@ -8,7 +8,7 @@ echo "cd homePath"
|
|||||||
cd $homePath
|
cd $homePath
|
||||||
|
|
||||||
echo "shutdown tank"
|
echo "shutdown tank"
|
||||||
source $homePath/doc/script/shutdown.sh
|
source $homePath/build/script/shutdown.sh
|
||||||
|
|
||||||
echo "git reset"
|
echo "git reset"
|
||||||
git reset --hard HEAD
|
git reset --hard HEAD
|
||||||
|
Loading…
Reference in New Issue
Block a user