pouchdb / pouchdb

:kangaroo: - PouchDB is a pocket-sized database.
https://pouchdb.com/
Apache License 2.0
16.88k stars 1.47k forks source link

Can't test Couchbase Sync Gateway in Travis without sudo #4231

Closed nolanlawson closed 9 years ago

nolanlawson commented 9 years ago

We'll soon be using the container-based Travis builds: https://github.com/pouchdb/pouchdb/issues/4193. Unfortunately the current build process for CSG involves wgetting a deb file and sudo dkpg to install it, and containers don't let you sudo.

Travis seems to only support pre-installing packages from the main registries (see this), which is how we're able to build CouchDB 2.x from source. @jchris any chance we'll be able to sudo apt-get install couchbase-sync-gateway sometime soon? Or somehow run it without needing sudo?

marten-de-vries commented 9 years ago

@nolanlawson I just experimented a bit and it seems the installation process described in that .deb is mostly extracting it (as default for any deb) and a couple of non-essential things (adding an init script, creating a specific user for the program). So, the following works for me locally (no sudo necessary):

marten@procyon:~$   curl -o csg.deb http://packages.couchbase.com/releases/couchbase-sync-gateway/1.0.3/couchbase-sync-gateway-community_1.0.3_x86_64.deb 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 4713k  100 4713k    0     0   793k      0  0:00:05  0:00:05 --:--:--  951k
marten@procyon:~$ dpkg --extract csg.deb csg && rm csg.deb 
marten@procyon:~$ cd csg/
marten@procyon:~/csg$ ls
etc  opt  usr
marten@procyon:~/csg$ ./opt/couchbase-sync-gateway/bin/sync_gateway ~/git/pouchdb/tests/misc/sync-gateway-config.json 
19:03:19.170651 Enabling logging: [HTTP+]
19:03:19.171091 ==== Couchbase Sync Gateway/1.0.3(81;fa9a6e7) ====
19:03:19.171190 Configured Go to use all 4 CPUs; setenv GOMAXPROCS to override this
19:03:19.171264 Starting admin server on 127.0.0.1:4985
19:03:19.177191 Starting server on :4984 ...
19:03:27.876642 HTTP:  #001: GET /  (ADMIN)
19:03:27.892744 HTTP+: #001:     --> 200   (19.4 ms)
^Cmarten@procyon:~/csg$ 
marten-de-vries commented 9 years ago

Also, unless there's a process on the way already, getting into Ubuntu/Debian repo's takes some time. Even if you get your package accepted directly, it won't be available until Travis upgrades the distro. And considering they're using LTS's (and very old ones at that), that's probably not a feasible option.

daleharvey commented 9 years ago

And done - https://github.com/pouchdb/pouchdb/commit/176730cdcd43196a18aff581471e000f42239e9f