Skip to content

Commit a63ac22

Browse files
authored
Fix: failed to startup with embedded etcd (#1038)
1 parent 13ae6f2 commit a63ac22

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

go.sum

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/
264264
github.com/glendc/gopher-json v0.0.0-20170414221815-dc4743023d0c h1:iRTj5SRYwbvsygdwVp+y9kZT145Y1s6xOPpeOEIeGc4=
265265
github.com/glendc/gopher-json v0.0.0-20170414221815-dc4743023d0c/go.mod h1:Gja1A+xZ9BoviGJNA2E9vFkPjjsl+CoJxSXiQM1UXtw=
266266
github.com/go-chassis/cari v0.0.0-20201210041921-7b6fbef2df11/go.mod h1:MgtsEI0AM4Ush6Lyw27z9Gk4nQ/8GWTSXrFzupawWDM=
267+
github.com/go-chassis/cari v0.3.0/go.mod h1:Ie2lW11Y5ZFClY9z7bhAwK6BoNxqGSf3fYGs4mPFs74=
267268
github.com/go-chassis/cari v0.3.1-0.20210508100214-a13e083de04e h1:YLXfK7pSRsYK7EzUnv7WDgJNOHQSXz+UIEbOF86XI6Q=
268269
github.com/go-chassis/cari v0.3.1-0.20210508100214-a13e083de04e/go.mod h1:Ie2lW11Y5ZFClY9z7bhAwK6BoNxqGSf3fYGs4mPFs74=
269270
github.com/go-chassis/cari v0.3.1-0.20210519092219-69f9f0fc3452 h1:G2Qlpg17t0oULhz0Eu3NQgkxKDcNbpGpmgtMR6RZvwk=
@@ -291,8 +292,12 @@ github.com/go-chassis/go-archaius v1.5.1 h1:1FrNyzzmD6o6BIjPF8uQ4Cc+u7qYIgQTpDk8
291292
github.com/go-chassis/go-archaius v1.5.1/go.mod h1:QPwvvtBxvwiC48rmydoAqxopqOr93RCQ6syWsIkXPXQ=
292293
github.com/go-chassis/go-chassis/v2 v2.1.2-0.20210310004133-c9bc42149a18 h1:bVzPkc+t08hN3YtKBv+icjQ0x6BZInbeyRil1q6qwvY=
293294
github.com/go-chassis/go-chassis/v2 v2.1.2-0.20210310004133-c9bc42149a18/go.mod h1:NaewTJacOEr9P4gN7Am4x1D1cwUgNtEq9tnKMNOZ47M=
295+
github.com/go-chassis/go-chassis/v2 v2.2.0 h1:CNr5Z+NJG2HRc+0jLiqufGhn8VuS3GA7i6PeO0JQvwc=
296+
github.com/go-chassis/go-chassis/v2 v2.2.0/go.mod h1:MpPxktD43gexx3qrOZM90gnoY3/uRHMRiYEeBmcxUuc=
294297
github.com/go-chassis/go-restful-swagger20 v1.0.3-0.20200310030431-17d80f34264f h1:5QmmNpVcGqIc6tuKNe5EAI4PA8Yn2EL9Oee7YdcJ4PE=
295298
github.com/go-chassis/go-restful-swagger20 v1.0.3-0.20200310030431-17d80f34264f/go.mod h1:eW62fYuzlNFDvIacB6AV8bhUDCTy4myfTCv0bT9Gbb0=
299+
github.com/go-chassis/go-restful-swagger20 v1.0.3 h1:kWfeLwMwJZVkXP1zNyFpkmR41UZ55UTcOptTteXhvEs=
300+
github.com/go-chassis/go-restful-swagger20 v1.0.3/go.mod h1:eW62fYuzlNFDvIacB6AV8bhUDCTy4myfTCv0bT9Gbb0=
296301
github.com/go-chassis/kie-client v0.0.0-20201210060018-938c7680a9ab/go.mod h1:UTdbtyN5ge/v9DmQzdVRxQP7z51Q4z6hyl+W6ZpUHFM=
297302
github.com/go-chassis/kie-client v0.1.0 h1:7iY0jVDVn6anT2Gh8CriViRqvyQOy9tUBUflVEkFZE4=
298303
github.com/go-chassis/kie-client v0.1.0/go.mod h1:UTdbtyN5ge/v9DmQzdVRxQP7z51Q4z6hyl+W6ZpUHFM=

scripts/build/tools.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,18 @@ fail() {
4141

4242
install_bower() {
4343
set +e
44-
BOWER=$(which bower)
44+
local NPM=$(which npm)
45+
set -e
4546
if [ "$?" == "1" ]; then
46-
set -e
47-
4847
curl -sL https://deb.nodesource.com/setup_8.x | bash -
4948
sudo apt-get install -y nodejs
49+
fi
5050

51+
set +e
52+
local BOWER=$(which bower)
53+
set -e
54+
if [ "$?" == "1" ]; then
5155
npm install -g bower
52-
else
53-
set -e
5456
fi
5557
}
5658

@@ -131,8 +133,13 @@ package() {
131133
local app=$PACKAGE_PREFIX-$RELEASE-$GOOS-$GOARCH
132134

133135
cp -r ${root_path}/etc/conf $app/
134-
sed -i 's/^manager_cluster.*=.*/manager_name = \"sr-0\"\nmanager_addr = \"http:\/\/127.0.0.1:2380\"\nmanager_cluster = \"sr-0=http:\/\/127.0.0.1:2380\"/g' $app/conf/app.conf
135-
sed -i 's/^registry_plugin.*=.*/registry_plugin = embeded_etcd/g' $app/conf/app.conf
136+
cat <<EOF >> $app/conf/app.yaml
137+
SERVER_HOST: 0.0.0.0
138+
REGISTRY_KIND: embeded_etcd
139+
REGISTRY_ETCD_CLUSTER_NAME: sc-0
140+
REGISTRY_ETCD_CLUSTER_MANAGER_ENDPOINTS: http://127.0.0.1:2380
141+
REGISTRY_ETCD_CLUSTER_ENDPOINTS: sc-0=http://127.0.0.1:2380
142+
EOF
136143

137144
## Copy the Service-Center Releases
138145
cp -r ${root_path}/scripts/release/LICENSE $app/

scripts/release/make_release.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ esac
4949

5050
## Get the arch type
5151
export GOARCH=${4:-"amd64"}
52+
## build all components
53+
export BUILD="ALL"
5254

5355
script_path=$(cd "$(dirname "$0")"; pwd)
5456

scripts/release/start_scripts/darwin/start-service-center.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,4 @@ root_path=$(cd "$(dirname "$0")"; pwd)
2121

2222
cd ${root_path}
2323

24-
#sed -i "s|^runmode.*=.*$|runmode = prod|g" conf/app.conf
25-
2624
./service-center > start-sc.log 2>&1 &

0 commit comments

Comments
 (0)