From 5280f3965c001ce65d8a7aaa66d0abe68732928e Mon Sep 17 00:00:00 2001 From: mhchia Date: Tue, 3 Sep 2019 17:41:17 +0800 Subject: [PATCH] Update install script for interop And adjust the structure of go packages for interop --- install_interop_go_pkgs.sh | 24 ++++++++++++++++++- .../interop/go_pkgs/{ => examples}/README.md | 0 .../go_pkgs/{ => examples}/echo/main.go | 0 tests/interop/go_pkgs/{ => examples}/go.mod | 0 tests/interop/go_pkgs/{ => examples}/go.sum | 0 .../go_pkgs/{ => examples}/utils/host.go | 0 6 files changed, 23 insertions(+), 1 deletion(-) rename tests/interop/go_pkgs/{ => examples}/README.md (100%) rename tests/interop/go_pkgs/{ => examples}/echo/main.go (100%) rename tests/interop/go_pkgs/{ => examples}/go.mod (100%) rename tests/interop/go_pkgs/{ => examples}/go.sum (100%) rename tests/interop/go_pkgs/{ => examples}/utils/host.go (100%) diff --git a/install_interop_go_pkgs.sh b/install_interop_go_pkgs.sh index cdf3193..585d620 100755 --- a/install_interop_go_pkgs.sh +++ b/install_interop_go_pkgs.sh @@ -1,5 +1,27 @@ #!/bin/bash +GO_PKGS_PATH=./tests/interop/go_pkgs + +DAEMON_REPO=go-libp2p-daemon +DAEMON_PATH=$GO_PKGS_PATH/$DAEMON_REPO + +EXAMPLES_PATHS=$GO_PKGS_PATH/examples + + go version -cd tests/interop/go_pkgs/ + +# Install `p2pd` +# FIXME: Use the canonical repo in libp2p, when we don't need `insecure`. +if [ ! -e "$DAEMON_PATH" ]; then + git clone git@github.com:mhchia/$DAEMON_REPO.git --branch test/add-options $DAEMON_PATH +fi +cd $DAEMON_PATH go install ./... + +cd - + +# Install example modeuls +cd $EXAMPLES_PATHS +go install ./... + +echo "Finish installing go modeuls for interop." diff --git a/tests/interop/go_pkgs/README.md b/tests/interop/go_pkgs/examples/README.md similarity index 100% rename from tests/interop/go_pkgs/README.md rename to tests/interop/go_pkgs/examples/README.md diff --git a/tests/interop/go_pkgs/echo/main.go b/tests/interop/go_pkgs/examples/echo/main.go similarity index 100% rename from tests/interop/go_pkgs/echo/main.go rename to tests/interop/go_pkgs/examples/echo/main.go diff --git a/tests/interop/go_pkgs/go.mod b/tests/interop/go_pkgs/examples/go.mod similarity index 100% rename from tests/interop/go_pkgs/go.mod rename to tests/interop/go_pkgs/examples/go.mod diff --git a/tests/interop/go_pkgs/go.sum b/tests/interop/go_pkgs/examples/go.sum similarity index 100% rename from tests/interop/go_pkgs/go.sum rename to tests/interop/go_pkgs/examples/go.sum diff --git a/tests/interop/go_pkgs/utils/host.go b/tests/interop/go_pkgs/examples/utils/host.go similarity index 100% rename from tests/interop/go_pkgs/utils/host.go rename to tests/interop/go_pkgs/examples/utils/host.go