Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
timfeirg committed Nov 1, 2016
1 parent cefc1cd commit fc5f16d
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 26 deletions.
27 changes: 14 additions & 13 deletions Makefile
Expand Up @@ -15,19 +15,20 @@ python:
cd ./rpc/gen/; python -m grpc.tools.protoc -I. --python_out=. --grpc_python_out=. core.proto; mv core_pb2.py ../../devtools/

deps:
go get github.com/docker/docker
go get github.com/docker/engine-api
go get github.com/docker/go-units
go get github.com/docker/go-connections
go get github.com/coreos/etcd
go get github.com/Sirupsen/logrus
go get github.com/stretchr/testify
go get github.com/golang/protobuf/proto
go get github.com/codegangsta/cli
go get gopkg.in/yaml.v2
go get gopkg.in/libgit2/git2go.v23
go get golang.org/x/net/context
go get google.golang.org/grpc
go get github.com/docker/engine-api || echo "oops"
go get github.com/docker/go-units || echo "oops"
go get github.com/docker/go-connections || echo "oops"
go get github.com/docker/distribution || echo "oops"
go get github.com/Sirupsen/logrus || echo "oops"
go get github.com/stretchr/testify || echo "oops"
go get github.com/golang/protobuf/{proto,protoc-gen-go} || echo "oops"
go get github.com/codegangsta/cli || echo "oops"
go get gopkg.in/yaml.v2 || echo "oops"
go get gopkg.in/libgit2/git2go.v23 || echo "oops"
go get golang.org/x/net/context || echo "oops"
go get google.golang.org/grpc || echo "oops"
go get github.com/coreos/etcd || echo "oops"
go get github.com/docker/docker || echo "oops"

build:
go build -ldflags "$(GO_LDFLAGS)" -a -tags netgo -installsuffix netgo -o eru-core
Expand Down
22 changes: 16 additions & 6 deletions README.md
Expand Up @@ -14,12 +14,22 @@ cd -
## setup dev environment

```shell
$ git config --global url."git@gitlab.ricebook.net:".insteadOf "https://gitlab.ricebook.net/"
$ go get gitlab.ricebook.net/platform/core.git
$ mv $GOPATH/src/gitlab.ricebook.net/platform/core.git $GOPATH/src/gitlab.ricebook.net/platform/core
$ cd $GOPATH/src/gitlab.ricebook.net/platform/core && go install
$ ln -s $GOPATH/src/gitlab.ricebook.net/platform/core $MY_WORK_SPACE/eru-core2
$ make deps
git config --global url."git@gitlab.ricebook.net:".insteadOf "https://gitlab.ricebook.net/"
go get gitlab.ricebook.net/platform/core.git
mv $GOPATH/src/gitlab.ricebook.net/platform/core.git $GOPATH/src/gitlab.ricebook.net/platform/core
cd $GOPATH/src/gitlab.ricebook.net/platform/core
make deps
make build
```

## Upgrade core on test/production server

```shell
make build
# test server
devtools/upgrade-eru-core.sh test eru-core
# prod server
devtools/upgrade-eru-core.sh
```

### GRPC
Expand Down
22 changes: 15 additions & 7 deletions devtools/upgrade-eru-core.sh
@@ -1,8 +1,16 @@
#!/bin/sh
#!/bin/bash

ssh liuyifu@c2-eru-1.ricebook.link -t 'sudo yum --enablerepo=ricebook clean metadata'
ssh liuyifu@c2-eru-1.ricebook.link -t 'sudo yum reinstall -y eru-core'
ssh liuyifu@c2-eru-1.ricebook.link -t 'sudo systemctl daemon-reload'
ssh liuyifu@c2-eru-1.ricebook.link -t 'sudo systemctl restart eru-core.service'
ssh liuyifu@c2-eru-1.ricebook.link -t 'sudo git --work-tree=/opt/citadel --git-dir=/opt/citadel/.git pull'
ssh liuyifu@c2-eru-1.ricebook.link -t 'sudo systemctl restart citadel'
if [ $1 == "test" ]; then
rsync -a /Users/timfeirg/gocode/src/gitlab.ricebook.net/platform/core sa-ricebook:~
ssh sa-ricebook -t 'sudo rm -rf /root/.go/src/gitlab.ricebook.net/platform/core'
ssh sa-ricebook -t 'sudo mv ~/core /root/.go/src/gitlab.ricebook.net/platform/core'
# ssh zzz1 -t 'sudo mv eru-core /usr/bin/eru-core'
# ssh zzz1 -t 'sudo systemctl restart eru-core.service'
else
ssh liuyifu@c2-eru-1.ricebook.link -t 'sudo yum --enablerepo=ricebook clean metadata'
ssh liuyifu@c2-eru-1.ricebook.link -t 'sudo yum reinstall -y eru-core'
ssh liuyifu@c2-eru-1.ricebook.link -t 'sudo systemctl daemon-reload'
ssh liuyifu@c2-eru-1.ricebook.link -t 'sudo systemctl restart eru-core.service'
ssh liuyifu@c2-eru-1.ricebook.link -t 'sudo git --work-tree=/opt/citadel --git-dir=/opt/citadel/.git pull'
ssh liuyifu@c2-eru-1.ricebook.link -t 'sudo systemctl restart citadel'
fi

0 comments on commit fc5f16d

Please sign in to comment.