Skip to content

Commit

Permalink
Merge pull request apache#191 from PhilYue/fix/quickstart
Browse files Browse the repository at this point in the history
Fix/quickstart
  • Loading branch information
AlexStocks authored Jun 23, 2021
2 parents 73949d3 + 8c758a9 commit 4bae729
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 19 deletions.
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
./dubbo-go-pixiu

# app
dubbo-go-pixiu
dubbo-go-pixiu.exe
dubbgo_server.out
samples/dubbogo/simple/server/app/app

/logs
/.idea
/.vscode
pkg/registry/zookeeper-4unittest/contrib/fatjar
pkg/registry/zookeeper-4unittest/contrib/fatjar


17 changes: 9 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,31 @@

cur_mkfile := $(abspath $(lastword $(MAKEFILE_LIST)))
currentPath := $(patsubst %/, %, $(dir $(cur_mkfile)))
$(info cur_makefile_path1=$(currentPath))
pixiuPath := /cmd/pixiu/
mainPath := $(currentPath)$(pixiuPath)
$(info $(mainPath))

targetName := dubbo-go-pixiu

api-config-path:=${api-config}
ifeq ("",$(api-config-path))
api-config-path = configs/api_config.yaml
ifeq (,$(api-config-path))
$(warning api-config-path is nil, default: configs/api_config.yaml)
api-config-path = configs/api_config.yaml
endif

config-path:=${config-path}
ifeq ("",$(config-path))
config-path = configs/conf.yaml
ifeq (,$(config-path))
$(warning config-path is nil, default: configs/conf.yaml)
config-path = configs/conf.yaml
endif

$(info api-config-path = $(api-config-path))
$(info config-path = $(config-path))

os := $(shell go env GOOS)
$(info os is $(os))
ifeq (windows,$(os))
targetName = dubbo-go-pixiu.exe
endif
exe := $(mainPath)$(targetName)
$(info path of exe is $(exe))
build:
cd $(mainPath) && go build -o $(targetName)

Expand Down
22 changes: 13 additions & 9 deletions docs/sample/dubbo_sample_startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,31 @@ if [ "$1" != "skip_zookeeper" ]; then
echo "zookeeper stated!"
fi


APP_PATH=../../samples/dubbogo/simple

go env -w GOPROXY=https://goproxy.cn,direct

echo "starting dubbogo provider!"
if [ -z "$CONF_PROVIDER_FILE_PATH" ]; then
export CONF_PROVIDER_FILE_PATH=../../sample/dubbogo/server/config/server.yml
fi
go build ../../sample/dubbogo/server/app/

provider_pid=$(ps -ef | grep ../../sample/dubbogo/server/app/ | grep -v 'grep' | awk '{print $2}')
go build -o $APP_PATH/server/app/ $APP_PATH/server/app/

provider_pid=$(ps -ef | grep $APP_PATH/server/app/ | grep -v 'grep' | awk '{print $2}')

if [ -n "$provider_pid" ]; then
echo "pid of old dubbogo provider is $provider_pid, kill it"
kill -9 "$provider_pid"
fi
nohup go run ../../sample/dubbogo/server/app/ >dubbgo_server.out &
nohup go run $APP_PATH/server/app/ >$APP_PATH/dubbgo_server.out &
sleep 10
echo "dubbogo provider started!"

## to start pixiu

echo "starting proxy!"

cd ../../
make run config-path=sample/dubbogo/proxy/conf.yaml api-config-path=sample/dubbogo/proxy/api_config.yaml

if [ -z "$CONF_PROVIDER_FILE_PATH" ]; then
export CONF_PROVIDER_FILE_PATH=samples/dubbogo/simple/server/profiles/test/server.yml
fi

make run config-path=samples/dubbogo/simple/proxy/conf.yaml api-config-path=samples/dubbogo/simple/proxy/api_config.yaml

0 comments on commit 4bae729

Please sign in to comment.