Connects Couchbase Lite to Couchbase Server
Go Shell Objective-C Ruby Smarty Python Other
Latest commit 660b1c9 Aug 25, 2016 @ajres ajres committed with tleyden Updated service wrapper lifecycle scripts to support Ubuntu 16 (#2050)
* Updated service wrapper lifecycle scripts to support Ubuntu 16
Permalink
Failed to load latest commit information.
app/Sync Gateway Added Mac wrapper app in app/ subdirectory Oct 1, 2015
auth Do not require signature for trusted ID tokens Aug 19, 2016
base Moves some expvar properties into the syncGateway_stats group (#2039) Aug 15, 2016
build Merge pull request #1955 from couchbase/feature/issue_1935 Jul 20, 2016
channels Allows single string channel in default sync function May 16, 2016
db Adds retry loops to TAP feed recover, cluster connection and putting … Aug 24, 2016
docs/design Fixes #1572 Refactor SG repo to remove need to modify GOPATH + use go… Feb 13, 2016
examples Update basic_sg_accel_config.json Aug 16, 2016
indexwriter Fixes for intermittent unit test failures (#1917) Jun 30, 2016
manifest Pick up go-couchbase fix for TAP feed termination (#2041) Aug 19, 2016
rest Adds retry loops to TAP feed recover, cluster connection and putting … Aug 24, 2016
service Updated service wrapper lifecycle scripts to support Ubuntu 16 (#2050) Aug 25, 2016
sg_accel Fixes for sg_accel startup issues Mar 9, 2016
tools Merge pull request #2052 from couchbase/feature/sgcollect_info_binary… Aug 25, 2016
.drone.yml Remove -race flag to speed up drone.io continuous builds Jul 22, 2016
.gitignore Add sg-accel Win service wrapper; .gitignore cleanup Jan 19, 2016
CONTRIBUTING.md changed google groups link to forums.couchbase.com Jan 17, 2015
LICENSE Added LICENSE file with Apache license Jul 30, 2013
Makefile Cleanup of Makefile and .gitignore Nov 10, 2015
README.md Add section on rebuilding code Jun 23, 2016
bench.sh Fixes #1641 As part of recent repo layout refactor bench.sh was removed Mar 9, 2016
bootstrap.sh Issue #1674 - only pass the commit parameter into bootstrap.sh Apr 12, 2016
build.sh Fixes #1641 As part of recent repo layout refactor bench.sh was removed Mar 9, 2016
main.go Run "gofmt -s -w ." to reformat entire repo Feb 15, 2016
rewrite-manifest.sh Add script to rewrite manifest Feb 19, 2016
set-version-stamp.sh Fixes #1606 - build.sh script is currently broken Feb 19, 2016
sync_gateway.sublime-project Moves the sg_accel functionality into two new packages - sg_accel and… Mar 4, 2016
test.sh Fixes #1641 As part of recent repo layout refactor bench.sh was removed Mar 9, 2016

README.md

Build Status

Couchbase Sync Gateway

Join the chat at https://gitter.im/couchbase/sync_gateway

Gluing Couchbase Lite to Couchbase Server

The Sync Gateway manages HTTP-based data access for mobile clients. It handles access control and data routing, so that a single large Couchbase Server cluster can manage data for multiple users and complex applications.

Product home page

Documentation

Downloads

Build pre-requisites

To build Sync Gateway from source, you must have the following installed:

  • Go 1.5 or later with your $GOPATH set to a valid directory

Install GCC

This is required on Sync Gateway 1.2 or later. Yum is used here, but if you are on Ubuntu/Debian you will want to use apt-get instead.

$ yum install gcc

Building From source (via go get)

$ go get -u -t github.com/couchbase/sync_gateway/...

At this point, you will have Sync Gateway and all of it's dependencies at the master branch for each dependency. To anchor the dependencies to the revisions specified in the manifest XML, do the following:

$ cd $GOPATH
$ ./src/github.com/couchbase/sync_gateway/tools/manifest-helper -u

After this operation completes you should have a new sync_gateway binary in $GOPATH/bin

Running Unit Tests

$ go test github.com/couchbase/sync_gateway/...

Rebuilding

If you need to make any changes to the source and want to rebuild, run:

$ go install github.com/couchbase/sync_gateway/...

which will overwrite the sync_gateway binary in $GOPATH/bin with the newer version.

Switching to a feature branch

First, checkout the branch you want for Sync Gateway:

$ cd $GOPATH/src/github.com/couchbase/sync_gateway/
$ git checkout -t remotes/origin/feature/issue_1688

Run go get again to get any missing dependencies (for example, new dependencies that have been added for this branch)

NOTE: you will get a lot of warnings from running this command.

$ cd $GOPATH/src/github.com/couchbase/sync_gateway/
$ go get -u 

Running go get here will put your Sync Gateway back on the master branch, so you'll need to go back to the feature branch again:

$ cd $GOPATH/src/github.com/couchbase/sync_gateway/
$ git checkout -t remotes/origin/feature/issue_1688

Anchor all dependencies to the revisions specified in the manifest:

$ cd $GOPATH
$ ./src/github.com/couchbase/sync_gateway/tools/manifest-helper -u

Run tests:

$ go test github.com/couchbase/sync_gateway/...

Switching back to the master branch

First, checkout the master branch in the Sync Gateway repo

$ cd $GOPATH/src/github.com/couchbase/sync_gateway/
$ git checkout master

Update all dependencies to checkout their master branch

$ cd $GOPATH
$ ./src/github.com/couchbase/sync_gateway/tools/manifest-helper -r

Update Sync Gateway and all dependencies to latest versions on github

$ go get -u -t github.com/couchbase/sync_gateway/...

Run tests:

$ go test github.com/couchbase/sync_gateway/...

Running Benchmarks

go test github.com/couchbase/sync_gateway/... -bench='LoggingPerformance' -benchtime 1m -run XXX
go test github.com/couchbase/sync_gateway/... -bench='RestApiGetDocPerformance' -cpu 1,2,4 -benchtime 1m -run XXX

Building From Source (via repo)

Running the scripts below will clone this repository and all of it's dependencies (pinned to specific versions as specified in the manifest)

$ mkdir ~/sync_gateway
$ cd ~/sync_gateway
$ brew install repo
$ wget https://raw.githubusercontent.com/couchbase/sync_gateway/master/bootstrap.sh
$ chmod +x bootstrap.sh
$ ./bootstrap.sh

Build

$ ./build.sh

Running Unit Tests

$ ./test.sh

Warning: If you see the following error message and no godeps directory is created when running bootstrap.sh

gpg: keyring `/Users/youruser/.repoconfig/gnupg/pubring.gpg' created
gpg: Signature made Wed  2 Mar 20:59:22 2016 GMT using DSA key ID 920F5C65
gpg: Can't check signature: public key not found
error: could not verify the tag 'v1.12.33'

Then See this ticket

Switching to a different branch

$ ./bootstrap.sh <commit-sha>

License

Apache 2 license.

Tutorials and Other Resources