-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from jarrpa/build-scripts
Script tool installation and linting
- Loading branch information
Showing
10 changed files
with
121 additions
and
199 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
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,35 @@ | ||
#!/bin/bash | ||
|
||
GOPATH=$(go env GOPATH) | ||
GOBINDIR="${GOPATH}/bin" | ||
|
||
install_dep() { | ||
DEPVER="${GO_DEP_VERSION}" | ||
if type dep >/dev/null 2>&1; then | ||
local version | ||
version=$(dep version | awk '/^ version/{print $3}') | ||
if [[ "${version}" == "${DEPVER}" || ${version} > ${DEPVER} ]]; then | ||
echo "dep ${DEPVER} or greater is already installed" | ||
return | ||
fi | ||
fi | ||
|
||
echo "Installing dep. Version: ${DEPVER:-latest}" | ||
export INSTALL_DIRECTORY="${GOBINDIR}" | ||
export DEP_RELEASE_TAG="${DEPVER}" | ||
curl -L https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | ||
} | ||
|
||
install_gometalinter() { | ||
GMLVER="${GO_METALINTER_VERSION}" | ||
if type gometalinter >/dev/null 2>&1; then | ||
echo "gometalinter already installed" | ||
return | ||
fi | ||
|
||
echo "Installing gometalinter. Version: ${GMLVER}" | ||
curl -L https://raw.githubusercontent.com/alecthomas/gometalinter/master/scripts/install.sh | bash -s -- -b "${GOBINDIR}" "${GMLVER}" | ||
} | ||
|
||
install_dep | ||
install_gometalinter |
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,12 @@ | ||
#!/bin/bash | ||
|
||
set -o pipefail | ||
|
||
if [[ -x "$(command -v gometalinter)" ]]; then | ||
# shellcheck disable=SC2086,SC2068 | ||
gometalinter -j ${GO_METALINTER_THREADS:-1} --sort path --sort line --sort column --deadline=9m \ | ||
--enable="gofmt" --exclude "method NodeGetId should be NodeGetID" \ | ||
--vendor --debug ${@-./...} |& stdbuf -oL grep "linter took\\|:warning:\\|:error:" | ||
else | ||
echo "WARNING: gometalinter not found, skipping lint tests" >&2 | ||
fi |
File renamed without changes.
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.