Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix pre-commit issue #812

Merged
merged 141 commits into from
Mar 23, 2019
Merged
Show file tree
Hide file tree
Changes from 136 commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
0226bbc
Update config.yml
Mar 8, 2019
a159397
Update config.yml
Mar 8, 2019
3893bb3
Update config.yml
Mar 8, 2019
72160a1
Update config.yml
Mar 8, 2019
af27f85
Update config.yml
Mar 8, 2019
40c4c06
Update config.yml
Mar 8, 2019
85486ef
Update config.yml
Mar 8, 2019
b23a91c
Update config.yml
Mar 8, 2019
3469c55
Update config.yml
Mar 8, 2019
a0f72f7
Update config.yml
Mar 8, 2019
dda365d
Update config.yml
Mar 8, 2019
428ccee
Update config.yml
Mar 8, 2019
941828d
Update config.yml
Mar 8, 2019
80db956
Update config.yml
Mar 8, 2019
bd20347
Update config.yml
Mar 8, 2019
531d4ee
Update config.yml
Mar 8, 2019
3583934
Update config.yml
Mar 8, 2019
a8070a5
Update config.yml
Mar 8, 2019
69f6b90
Update config.yml
Mar 8, 2019
41274c8
Update config.yml
Mar 8, 2019
8085644
Update config.yml
Mar 9, 2019
c27a9ca
Merge branch 'master' into master
raullenchai Mar 9, 2019
78f8292
Update config.yml
Mar 10, 2019
720326f
use xcode: "10.1.0"
Mar 10, 2019
1f9715e
add run dep ensure
Mar 10, 2019
a2e98d8
restore config.yml add test macos build
Mar 10, 2019
4aa189e
xcode 10.2
Mar 10, 2019
c2659f1
test macos 10.14
Mar 10, 2019
d432009
Update config.yml
Mar 10, 2019
ed0ef22
Update config.yml
Mar 10, 2019
d065a5b
Merge branch 'master' into master
raullenchai Mar 10, 2019
a92d4b2
Update config.yml
Mar 10, 2019
2aa287a
test macos sync s3
Mar 13, 2019
89dc3dd
change sync to put
Mar 13, 2019
d219f13
Update config.yml
Mar 13, 2019
fe61f09
test docker and macos use S3 var
Mar 14, 2019
f304e3a
Update config.yml
Mar 14, 2019
6543731
Update config.yml
Mar 14, 2019
daeafc7
test install s3
Mar 14, 2019
4fa43fd
Update install-cli.sh
Mar 14, 2019
d6cdd9d
merge
Mar 14, 2019
eae2ba7
Merge branch 'iotexproject-master'
Mar 14, 2019
0cfaebc
Update config.yml
Mar 14, 2019
dfce9cc
add ioctl deploy to S3
Mar 14, 2019
9e69fff
add --unstable specified download S3 ioctl
Mar 14, 2019
f12521e
change docker install awscli
Mar 14, 2019
f7b178e
Update config.yml
Mar 14, 2019
1dcb08e
Update config.yml
Mar 14, 2019
94c9b99
Update config.yml
Mar 14, 2019
b26bb64
Update config.yml
Mar 14, 2019
1caf3ff
Merge branch 'master' into master
raullenchai Mar 14, 2019
4847a2d
Merge branch 'master' into master
raullenchai Mar 14, 2019
290026a
Merge branch 'master' into master
raullenchai Mar 15, 2019
93cd65e
Merge pull request #2 from iotexproject/master
Mar 15, 2019
e1ec037
Update config.yml
Mar 15, 2019
b801b48
Update config.yml
Mar 15, 2019
2ceda15
Update config.yml
Mar 15, 2019
8e0c129
Update config.yml
Mar 15, 2019
b050c0f
Update config.yml
Mar 15, 2019
808f957
Update config.yml
Mar 15, 2019
005f698
Update config.yml
Mar 15, 2019
bf420c0
Update config.yml
Mar 15, 2019
06a0c91
Update config.yml
Mar 15, 2019
88f2c97
Update config.yml
Mar 15, 2019
65891f7
Update config.yml
Mar 15, 2019
4f2d23f
Update config.yml
Mar 15, 2019
9bea61b
Update config.yml
Mar 15, 2019
e29cdb5
Update config.yml
Mar 15, 2019
3cd36ea
Update config.yml
Mar 15, 2019
fa8efe6
Update config.yml
Mar 15, 2019
19d70c0
Update config.yml
Mar 15, 2019
74997d9
Update config.yml
Mar 15, 2019
01122de
update golang 1.11
Mar 15, 2019
6f59568
Update config.yml
Mar 15, 2019
745d6a6
Update config.yml
Mar 15, 2019
cafaab9
Update config.yml
Mar 15, 2019
93bb2b5
Update config.yml
Mar 15, 2019
d8b028c
Update config.yml
Mar 15, 2019
fd6720e
Update config.yml
Mar 15, 2019
fd74f6c
Update config.yml
Mar 15, 2019
5ef0eb1
Update config.yml
Mar 15, 2019
be3283f
Update config.yml
Mar 15, 2019
75a7d4f
macos change golang to 1.11.6
Mar 15, 2019
fc7dc9d
macos use curl
Mar 15, 2019
47bd8f4
Update config.yml
Mar 15, 2019
2d2846d
Update config.yml
Mar 15, 2019
2a205a4
Update config.yml
Mar 15, 2019
d8424c8
ok
Mar 15, 2019
142cc1a
nightly_ioctl_build_darwin install golang 1.11.6
Mar 15, 2019
ceda16d
Update config.yml
Mar 15, 2019
a01d0a6
Update config.yml
Mar 15, 2019
535e1b4
Merge branch 'master' into master
raullenchai Mar 16, 2019
82d9282
Update config.yml
Mar 16, 2019
015c983
use golang 1.11.5
Mar 16, 2019
24ff0f5
debug env
Mar 16, 2019
e74f6b3
return env
Mar 16, 2019
1982d75
return golang 1.11.6
Mar 16, 2019
f7ee2b5
enable build 3 test
Mar 16, 2019
64661a3
test buildcli
Mar 16, 2019
8c45daf
install libc6-dev-i386
Mar 16, 2019
ff4db1a
sudo apt-get install libc6-dev-i386
Mar 16, 2019
b6cc2b1
test release
Mar 16, 2019
55ac4eb
use pip install awscli
Mar 16, 2019
02b3821
aws sync
Mar 16, 2019
3b37594
test ioctl darwin
Mar 16, 2019
bdafb9d
test maocs ioctl
Mar 16, 2019
38c6273
Update config.yml
Mar 16, 2019
89b461b
Update config.yml
Mar 16, 2019
4ed467c
Update config.yml
Mar 16, 2019
165137d
Update config.yml
Mar 16, 2019
17df77d
Update config.yml
Mar 16, 2019
eb5be25
use requires ubuntu
Mar 16, 2019
66f3aaf
fix syntax
Mar 16, 2019
fe7948e
disable go build 386
Mar 17, 2019
e0d2d42
debug build ioctl
Mar 17, 2019
64852ec
debug ubuntu build
Mar 17, 2019
a2ed340
debug 3 build_test_*
Mar 17, 2019
6b126d6
Merge branch 'master' into feiren-dev
Mar 17, 2019
e2b77a5
Merge pull request #3 from feigu1984/feiren-dev
Mar 17, 2019
54e04dc
skip ubuntu
Mar 17, 2019
721e4e5
skil ubuntu
Mar 17, 2019
9431d0c
delete job build_test_ubuntu
Mar 18, 2019
fb331a7
Merge pull request #4 from iotexproject/master
Mar 18, 2019
1fb8c44
test pre-push
Mar 18, 2019
9638fe8
test hooks pre-commit
Mar 19, 2019
907a9ad
Merge pull request #5 from iotexproject/master
Mar 19, 2019
fabd4f0
test hooks pre-commit
Mar 19, 2019
34d6357
Merge branch 'master' into master
Mar 19, 2019
8ea3ccb
update (#6)
Mar 20, 2019
0a2e8e4
Merge branch 'master' into master
raullenchai Mar 20, 2019
e6e6e5c
disable build_test_ubuntu
Mar 20, 2019
2b743c9
fix go evn , ioctl to /usr/local/bin
Mar 21, 2019
dde5a3b
fix pre-commit
Mar 21, 2019
077dc54
fix pre-commit
Mar 21, 2019
7dca815
fix pre-commit
Mar 21, 2019
f092508
fix pre-commit
Mar 21, 2019
3b8d16b
revert
Mar 22, 2019
c9a89d0
Merge branch 'master' into master
raullenchai Mar 22, 2019
7faec3e
Merge branch 'master' into master
raullenchai Mar 22, 2019
538a0f5
Merge branch 'master' into master
raullenchai Mar 22, 2019
9eb679d
Merge branch 'master' into master
raullenchai Mar 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 46 additions & 20 deletions install-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ set -e

RELEASES_URL="https://github.com/iotexproject/iotex-core/releases"
S3URL="https://s3-ap-southeast-1.amazonaws.com/ioctl"
INSTALL_DIRECTORY="/usr/local/bin"
GO_VERSION="1.11.6"

downloadJSON() {
url="$2"
Expand Down Expand Up @@ -62,7 +64,28 @@ downloadFile() {
exit 1
fi
}

install_golang() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to install golang...

GO_URL="https://dl.google.com/go"
GO_Archive="go${GO_VERSION}.${OS}-${ARCH}"
if [ "$OS" = "windows" ]; then
echo "todo ....."
exit 0
#downloadFile "${GO_URL}/${GO_Archive}.zip" "${GO_Archive}.zip"
else
downloadFile "${GO_URL}/${GO_Archive}.tar.gz" "${GO_Archive}.tar.gz"
sudo tar -C /usr/local -xzf ${GO_Archive}.tar.gz
if [ $? -ne 0 ]; then
echo "unable to install go"
exit 1
fi
echo "\033[33m The golang install to '/usr/local/go' \033[0m"
env_file="$HOME/.bashrc"
echo "export GOPATH=~/go" >> $env_file
echo "export GOROOT=/usr/local/go" >> $env_file
echo 'export PATH=$PATH:$GOPATH/bin:$PATH:$GOROOT/bin' >> $env_file
echo 'Please \033[33m source "$HOME/.bashrc" \033[0m'
fi
}
findGoBinDirectory() {
EFFECTIVE_GOPATH=$(go env GOPATH)
# CYGWIN: Convert Windows-style path into sh-compatible path
Expand All @@ -82,7 +105,6 @@ findGoBinDirectory() {
fi
eval "$1='$GOBIN'"
}

initArch() {
ARCH=$(uname -m)
case $ARCH in
Expand All @@ -99,7 +121,6 @@ initArch() {
esac
echo "ARCH = $ARCH"
}

initOS() {
OS=$(uname | tr '[:upper:]' '[:lower:]')
OS_CYGWIN=0
Expand All @@ -117,33 +138,31 @@ initOS() {
esac
echo "OS = $OS"
}

# identify platform based on uname output


initArch
initOS


# determine install directory if required
if [ -z "$INSTALL_DIRECTORY" ]; then
findGoBinDirectory INSTALL_DIRECTORY
fi
#if [ -z "$INSTALL_DIRECTORY" ]; then
# findGoBinDirectory INSTALL_DIRECTORY
#fi
echo "Will install into $INSTALL_DIRECTORY"

# assemble expected release artifact name
if [ "${OS}" != "linux" ] && { [ "${ARCH}" = "ppc64" ] || [ "${ARCH}" = "ppc64le" ];}; then
# ppc64 and ppc64le are only supported on Linux.
echo "${OS}-${ARCH} is not supported by this instalation script"
else
BINARY="ioctl-${OS}-${ARCH}"
fi

# add .exe if on windows
if [ "$OS" = "windows" ]; then
BINARY="$BINARY.exe"
fi

if [ "$1" = "unstable" ]; then
BINARY_URL="$S3URL/$BINARY"

else
# if DEP_RELEASE_TAG was not provided, assume latest
if [ -z "$CLI_RELEASE_TAG" ]; then
Expand All @@ -155,19 +174,26 @@ else
downloadJSON RELEASE_DATA "$RELEASES_URL/tag/$CLI_RELEASE_TAG"
BINARY_URL="$RELEASES_URL/download/$CLI_RELEASE_TAG/$BINARY"
fi

DOWNLOAD_FILE=$(mktemp)

downloadFile "$BINARY_URL" "$DOWNLOAD_FILE"

echo "Setting executable permissions."
chmod +x "$DOWNLOAD_FILE"

sudo chmod +x "$DOWNLOAD_FILE"
INSTALL_NAME="ioctl"

if [ "$OS" = "windows" ]; then
INSTALL_NAME="$INSTALL_NAME.exe"
fi

echo "Moving executable to $INSTALL_DIRECTORY/$INSTALL_NAME"
mv "$DOWNLOAD_FILE" "$INSTALL_DIRECTORY/$INSTALL_NAME"
echo "\033[33m Moving executable to $INSTALL_DIRECTORY/$INSTALL_NAME \033[0m"
sudo mv "$DOWNLOAD_FILE" "$INSTALL_DIRECTORY/$INSTALL_NAME"

if ! [ $(command -v go) ];then

echo "\033[33m You OS is not install golang! The ioctl depends on it.....!\033[0m"
while true; do
read -p " Do you wish to install this golang? [Y/y]es or [N/n]o: " yn
case $yn in
[Yy]* ) echo "\033[33m Install golang $GO_VERSION \033[0m" ;install_golang; break;;
[Nn]* ) echo "Later Manual installation" ;exit 0;;
* ) echo "Please answer [Y/y]es or [N/n]o";;
esac
done
fi
5 changes: 2 additions & 3 deletions pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

#CURR_DIR="$(dirname $0)"
#workspace=$(cd ../../)
gopath=$(go env|grep GOPATH)
export LD_LIBRARY_PATH=:${gopath}/src/github.com/iotexproject/iotex-core/crypto/lib
export LD_LIBRARY_PATH=:$GOPATH/src/github.com/iotexproject/iotex-core/crypto/lib
check_result() {
if [ $? != 0 ]; then
echo "$1 failed!!"
Expand All @@ -23,7 +22,7 @@ check_result() {
fi
}

cd ../../ && ./go.test.sh
./go.test.sh
check_result go.test.sh
curl -s https://codecov.io/bash|bash
go test -run=XXX -bench=. $(go list ./crypto)
Expand Down