-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor optimize on log file collection (#16)
* *: minor optimize of coding style * logfiles: fix bugs when collecting log files with ansible * logfiles: fix wrong checking params when called by ansible * makefile: add script to build release tarball
- Loading branch information
1 parent
8032d67
commit 7645622
Showing
7 changed files
with
79 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,9 @@ bin/ | |
data/ | ||
|
||
.vscode/ | ||
.build/ | ||
|
||
*.log | ||
|
||
# Binaries for programs and plugins | ||
*.exe | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,6 @@ all: default | |
|
||
collector: | ||
$(MAKE) -C collector $(MAKECMDGOALS) | ||
|
||
package: | ||
./package.sh 2>package.err.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/sh | ||
|
||
# make a release tarball | ||
|
||
if [ -z $1 ]; then | ||
RELVER=`git describe --tags` | ||
else | ||
RELVER=$1 | ||
fi | ||
RELPATH=tidb-insight-${RELVER} | ||
|
||
GO_RELEASE_BIN=go1.10.3.linux-amd64 | ||
|
||
BUILD_ROOT="`pwd`/.build" | ||
mkdir -p ${BUILD_ROOT} | ||
cd ${BUILD_ROOT} | ||
|
||
if [ ! -f ${GO_RELEASE_BIN}.tar.gz ]; then | ||
wget https://dl.google.com/go/${GO_RELEASE_BIN}.tar.gz | ||
tar zxf ${GO_RELEASE_BIN}.tar.gz | ||
fi | ||
|
||
GOROOT="${BUILD_ROOT}/go" | ||
GOPATH="${BUILD_ROOT}/.go" | ||
export GOROOT GOPATH | ||
|
||
# clean exist binaries | ||
rm -rf ${BUILD_ROOT}/tidb-insight-* | ||
mkdir -p ${BUILD_ROOT}/${RELPATH}/ | ||
cp -rf ${BUILD_ROOT}/../* ${BUILD_ROOT}/${RELPATH}/ | ||
|
||
cd ${BUILD_ROOT}/${RELPATH}/collector/ | ||
|
||
# prepare dependencies | ||
GOBIN=${GOROOT}/bin/go make deps | ||
# compile a static binary | ||
GOBIN=${GOROOT}/bin/go make static | ||
|
||
# clean unecessary files | ||
cd ${BUILD_ROOT}/${RELPATH} | ||
rm -rf collector docs tests Makefile package.sh *.log | ||
find ${BUILD_ROOT}/${RELPATH} -name "*.pyc" | xargs rm | ||
|
||
# make tarball archive | ||
cd ${BUILD_ROOT} | ||
tar zcf ${RELPATH}.tar.gz ${RELPATH} |