From 5254e8560088faa72ec6de4763174ac2fee2c9cc Mon Sep 17 00:00:00 2001 From: linxiaozhi Date: Sun, 17 Feb 2019 09:15:19 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=B7=BB=E5=8A=A0build=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=202.=E6=9B=B4=E6=96=B0.gitgnore=203.?= =?UTF-8?q?=E6=9B=B4=E6=96=B0readme.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 7 +++---- README.md | 2 ++ build.sh | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 4 deletions(-) create mode 100755 build.sh diff --git a/.gitignore b/.gitignore index 922b664..50c373b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ -PPGo_Job - +.DS_Store .idea - -info.log \ No newline at end of file +PPGo_Job* +info.log diff --git a/README.md b/README.md index 4f3602c..08aed55 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,9 @@ jobs/job.go:19:2: cannot find package "golang.org/x/crypto/ssh" in any of: 需要 git clone https://github.com/golang/crypto.git 并拷贝到 $GOPATH/src/golang.org/x/ 下就OK + 或 + git clone https://github.com/golang/crypto.git $GOPATH/src/golang.org/x/crypto # Docker diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..c28008a --- /dev/null +++ b/build.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# @Author: Bee +# @Date: 2019-02-17 08:38:58 +# @Last Modified by: Bee +# @Last Modified time: 2019-02-17 08:38:58 + +version=$1 + +command -v tar >/dev/null 2>&1 || { echo >&2 "请检查tar是否已安装!"; exit 1; } +command -v go >/dev/null 2>&1 || { echo >&2 "请检查golang是否已安装或环境变量是否正确!"; exit 1; } + +if [[ ! -n "$version" ]];then + echo "请执行如:" + echo "$0 1.0.0" + exit 1 +fi + +if [[ ! -d "build" ]];then + mkdir build +fi + +go build -o PPGo_Job + +cp -r -p PPGo_Job build/PPGo_Job +cp -r -p run.sh build/run.sh +cp -r -p conf build/conf +cp -r -p static build/static +cp -r -p views build/views +rm -rf build/static/imgs + +cd build && tar zcvf ../PPGo_Job-$version.tar.gz . + +rm -rf ../build \ No newline at end of file