1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-13 17:51:02 +00:00

Support etcd

This commit is contained in:
Ming Deng
2020-08-26 03:46:22 +00:00
parent 5b35bf6065
commit c2361170b3
20 changed files with 581 additions and 257 deletions

View File

@ -7,24 +7,37 @@ services:
- mysql
- postgresql
- memcached
- etcd
env:
global:
- GO_REPO_FULLNAME="github.com/astaxie/beego"
matrix:
- ORM_DRIVER=sqlite3 ORM_SOURCE=$TRAVIS_BUILD_DIR/orm_test.db
- ORM_DRIVER=postgres ORM_SOURCE="user=postgres dbname=orm_test sslmode=disable"
- ORM_DRIVER=mysql export ORM_SOURCE="root:@/orm_test?charset=utf8"
before_install:
# link the local repo with ${GOPATH}/src/<namespace>/<repo>
- GO_REPO_NAMESPACE=${GO_REPO_FULLNAME%/*}
# relies on GOPATH to contain only one directory...
- mkdir -p ${GOPATH}/src/${GO_REPO_NAMESPACE}
- ln -sv ${TRAVIS_BUILD_DIR} ${GOPATH}/src/${GO_REPO_FULLNAME}
- cd ${GOPATH}/src/${GO_REPO_FULLNAME}
# get and build ssdb
- git clone git://github.com/ideawu/ssdb.git
- cd ssdb
- make
- cd ..
# link the local repo with ${GOPATH}/src/<namespace>/<repo>
- GO_REPO_NAMESPACE=${GO_REPO_FULLNAME%/*}
# relies on GOPATH to contain only one directory...
- mkdir -p ${GOPATH}/src/${GO_REPO_NAMESPACE}
- ln -sv ${TRAVIS_BUILD_DIR} ${GOPATH}/src/${GO_REPO_FULLNAME}
- cd ${GOPATH}/src/${GO_REPO_FULLNAME}
# get and build ssdb
- git clone git://github.com/ideawu/ssdb.git
- cd ssdb
- make
- cd ..
# - prepare for etcd unit tests
- git clone https://github.com/etcd-io/etcd.git
- cd etcd
- ./build
- ./bin/etcd
- ./bin/etcdctl put current.float 1.23
- ./bin/etcdctl put current.bool true
- ./bin/etcdctl put current.int 11
- ./bin/etcdctl put current.string hello
- ./bin/etcdctl put current.serialize.name test
- cd ..
install:
- go get github.com/lib/pq
- go get github.com/go-sql-driver/mysql
@ -52,6 +65,7 @@ install:
- go get -u github.com/go-redis/redis
before_script:
- psql --version
# - prepare for orm unit tests
- sh -c "if [ '$ORM_DRIVER' = 'postgres' ]; then psql -c 'create database orm_test;' -U postgres; fi"
- sh -c "if [ '$ORM_DRIVER' = 'mysql' ]; then mysql -u root -e 'create database orm_test;'; fi"
- sh -c "if [ '$ORM_DRIVER' = 'sqlite' ]; then touch $TRAVIS_BUILD_DIR/orm_test.db; fi"