Change the folder structure.

This commit is contained in:
Zic
2017-12-23 23:12:03 +08:00
parent deaeb39618
commit 1f01b89c4c
6 changed files with 32 additions and 49 deletions

View File

@ -1,68 +0,0 @@
@if "%DEBUG%" == "" echo off
@rem ##########################################################################
@rem
@rem Tank build script for Windows
@rem
@rem ##########################################################################
@REM ==== START VALIDATION ====
if "%GOPATH%"=="" (
echo The GOPATH environment variable is not defined correctly
goto end
)
set PRE_DIR=%cd%
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
@rem echo go get golang.org/x
@rem go get golang.org/x
@rem resize image
echo go get github.com/disintegration/imaging
go get github.com/disintegration/imaging
@rem json parser
echo go get github.com/json-iterator/go
go get github.com/json-iterator/go
@rem mysql
echo go get github.com/go-sql-driver/mysql
go get github.com/go-sql-driver/mysql
@rem dao database
echo go get github.com/jinzhu/gorm
go get github.com/jinzhu/gorm
@rem uuid
echo go get github.com/nu7hatch/gouuid
go get github.com/nu7hatch/gouuid
echo build tank ...
go install tank
echo packaging
set distPath=%GOPATH%\src\tank\dist
if exist %distPath% (
echo clear %distPath%
rmdir /s/q %distPath%
)
echo create directory %distPath%
md %distPath%
echo copying tank.exe
copy %GOPATH%\bin\tank.exe %distPath%
echo copying build
xcopy %GOPATH%\src\tank\build %distPath% /e/h
cd %PRE_DIR%
echo check the dist file in %distPath%
echo finish!

View File

@ -1,62 +0,0 @@
#!/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
cd $PRE_DIR
echo "check the dist file in $distPath"
echo "finish!"

View File

@ -1,22 +0,0 @@
#!/bin/bash
# executable path
EXE_PATH=$GOPATH/bin/tank
# execute arguments
MysqlHost=127.0.0.1
MysqlPort=3306
MysqlSchema=tank
MysqlUserName=tank
MysqlPassword=Tank_123
AdminUsername=admin
AdminEmail=lish516@126.com
AdminPassword=123456
if [ -f "$EXE_PATH" ]; then
nohup $EXE_PATH -MysqlHost=$MysqlHost -MysqlPort=$MysqlPort -MysqlSchema=$MysqlSchema -MysqlUserName=$MysqlUserName -MysqlPassword=$MysqlPassword -AdminUsername=$AdminUsername -AdminEmail=$AdminEmail -AdminPassword=$AdminPassword >/dev/null 2>&1 &
else
echo 'Cannot find $EXE_PATH.'
exit 1
fi

View File

@ -1,27 +0,0 @@
#!/bin/sh
homePath=$GOPATH/src/tank
oldPath=$(pwd)
echo "cd homePath"
cd $homePath
echo "shutdown tank"
source $homePath/build/script/shutdown.sh
echo "git reset"
git reset --hard HEAD
echo "git pull"
git pull
echo "go install tank"
go install tank
cd $oldPath
echo "startup tank"
source $homePath/doc/script/startup.sh