Skip to content
This repository has been archived by the owner on Aug 7, 2019. It is now read-only.

Commit

Permalink
Merge pull request #133 from mitchellrj/patch-1
Browse files Browse the repository at this point in the history
Add documentation on running your own repository
  • Loading branch information
Caolan McMahon committed Mar 2, 2013
2 parents 393b1fc + 4fb6187 commit be789a1
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions README.md
Expand Up @@ -125,6 +125,8 @@ exports.repositories = [
];
```

See the section below on running your own repository.


### package\_dir

Expand Down Expand Up @@ -164,6 +166,85 @@ You can then run the integration tests using `test/integration.sh` or
`test/all.sh` or `test\all.bat`.


## Running your own private repository or mirror
1. Install couchdb

#### Mac OS X:

1. Install [Homebrew](http://mxcl.github.com/homebrew/).
2.

```
brew install couchdb
```

#### Ubuntu:

```
apt-get install couchdb
```
2. Configure your database

```
curl -X POST http://127.0.0.1:5984/_replicate -d '{
"source":"http://jamjs.org/repository",
"target":"http://localhost:5984/repository",
"continuous":true,
"doc_ids":["_design/jam-packages"]
}' -H "Content-Type: application/json"
```

#### To create a mirror:

```
curl -X POST http://127.0.0.1:5984/_replicate -d '{
"source":"http://jamjs.org/repository",
"target":"repository",
"continuous":true,
"create_target":true
}' -H "Content-Type: application/json"
```

#### To create an empty, private repository:

```
curl -X PUT http://127.0.0.1:5984/repository
```

3. Edit your ```.jamrc``` file to use your new repository:

```
exports.repositories = [
{
url: "http://localhost:5984/repository",
search: false
},
"http://jamjs.org/repository"
];
```

### Adding search

1. [Install couchdb-lucene](https://github.com/rnewson/couchdb-lucene#build-and-run-couchdb-lucene)
2. Restart couchdb.
3. Edit your ```.jamrc``` file to allow searching on your repository:

```
exports.repositories = [
{
url: "http://localhost:5984/repository",
search: "http://localhost:5984/_fti/local/repository/_design/jam-packages/packages/"
},
"http://jamjs.org/repository"
];
```

### Publishing packages to your private repository

```
jam publish --repository http://localhost:5984/repository
```

## More documentation

To learn how to create and publish packages etc, and for more info on using
Expand Down

0 comments on commit be789a1

Please sign in to comment.