Skip to content

Commit

Permalink
[TASK] Prepare for publication
Browse files Browse the repository at this point in the history
  • Loading branch information
justmoon committed Oct 31, 2015
1 parent 1c1ba72 commit 1468c85
Show file tree
Hide file tree
Showing 30 changed files with 624 additions and 606 deletions.
13 changes: 10 additions & 3 deletions README.md
@@ -1,10 +1,17 @@
# Five Bells Ledger [![Circle CI](https://circleci.com/gh/ripple/five-bells-ledger/tree/master.svg?style=svg&circle-token=e31b3ba89c015bf7f1c6de9f5156e7daa32fd793)](https://circleci.com/gh/ripple/five-bells-ledger/tree/master) [![Docker Repository on Quay.io](https://quay.io/repository/ripple/five-bells-ledger/status?token=5d3a0893-14d4-4392-8a86-9fcc484c43c3 "Docker Repository on Quay.io")](https://quay.io/repository/ripple/five-bells-ledger) [![Coverage Status](https://coveralls.io/repos/ripple/five-bells-ledger/badge.svg?branch=master&t=oMxPKt)](https://coveralls.io/r/ripple/five-bells-ledger?branch=master)
# Five Bells Ledger [![npm][npm-image]][npm-url] [![circle][circle-image]][circle-url] [![coveralls][coveralls-image]][coveralls-url]

[npm-image]: https://img.shields.io/npm/v/constitute.svg?style=flat
[npm-url]: https://npmjs.org/package/five-bells-ledger
[circle-image]: https://circleci.com/gh/interledger/five-bells-ledger.svg?style=shield&circle-token=e31b3ba89c015bf7f1c6de9f5156e7daa32fd793
[circle-url]: https://circleci.com/gh/interledger/five-bells-ledger
[coveralls-image]: https://coveralls.io/repos/interledger/five-bells-ledger/badge.svg?branch=master&t=oMxPKt
[coveralls-url]: https://coveralls.io/r/interledger/five-bells-ledger?branch=master

> A reference implementation of the Five Bells Ledger API
## Usage

You can see the ledger in action as part of the [`five-bells-demo`](https://github.com/ripple/five-bells-demo)!
You can see the ledger in action as part of the [`five-bells-demo`](https://github.com/interledger/five-bells-demo)!

To run the ledger as a standalone server:

Expand Down Expand Up @@ -60,7 +67,7 @@ npm run migrate
Then run the following (with the same environment variables) as described above:

``` sh
docker run -it --rm --net=host -e LEDGER_PORT=1337 -e LEDGER_DB_URI=$LEDGER_DB_URI quay.io/ripple/five-bells-ledger
docker run -it --rm --net=host -e LEDGER_PORT=1337 -e LEDGER_DB_URI=$LEDGER_DB_URI interleder/five-bells-ledger
```

Breaking down that command:
Expand Down
2 changes: 1 addition & 1 deletion app.js
Expand Up @@ -12,7 +12,7 @@ const serve = require('koa-static')
const router = require('koa-router')()
const cors = require('koa-cors')
const passport = require('koa-passport')
const errorHandler = require('@ripple/five-bells-shared/middlewares/error-handler')
const errorHandler = require('five-bells-shared/middlewares/error-handler')
const koa = require('koa')
const path = require('path')
const log = require('./src/services/log')
Expand Down
14 changes: 7 additions & 7 deletions circle.yml
Expand Up @@ -7,13 +7,13 @@ machine:
dependencies:
pre:
# Build container
- docker build -t quay.io/ripple/five-bells-ledger .
- docker build -t interledger/five-bells-ledger .
test:
override:
# Run lint
- npm run lint
# Run tests with coverage
- docker run --name=ledger-test -it --net=host -e LEDGER_DB_URI=mysql://ubuntu@localhost/circle_test -v /usr/src/app/coverage quay.io/ripple/five-bells-ledger sh -c 'npm run migrate ; npm test --coverage -- -R spec-xunit-file'
- docker run --name=ledger-test -it --net=host -e LEDGER_DB_URI=mysql://ubuntu@localhost/circle_test -v /usr/src/app/coverage interledger/five-bells-ledger sh -c 'npm run migrate ; npm test --coverage -- -R spec-xunit-file'
# Extract test artifacts (results and coverage data)
- docker cp ledger-test:/usr/src/app/xunit.xml ${CIRCLE_TEST_REPORTS}/
- docker cp ledger-test:/usr/src/app/coverage .
Expand All @@ -22,15 +22,15 @@ deployment:
branch: master
commands:
# Upload coverage data
- docker run --volumes-from ledger-test -e COVERALLS_TOKEN=${COVERALLS_TOKEN} quay.io/ripple/five-bells-ledger npm run coveralls
- docker run --volumes-from ledger-test -e COVERALLS_TOKEN=${COVERALLS_TOKEN} interledger/five-bells-ledger npm run coveralls
# Push NPM package if not yet published
- mv npmrc-env .npmrc
- if [ -z "$(npm info $(npm ls --depth=-1 2>/dev/null | head -1 | cut -f 1 -d " ") 2>/dev/null)" ] ; then npm publish ; fi
# Push Docker image tagged latest and tagged with commit descriptor
- sed "s/<AUTH>/${QUAY_TOKEN}/" < "dockercfg-template" > ~/.dockercfg
- docker tag quay.io/ripple/five-bells-ledger:latest quay.io/ripple/five-bells-ledger:$(git describe)
- docker push quay.io/ripple/five-bells-ledger:latest
- docker push quay.io/ripple/five-bells-ledger:$(git describe)
- sed "s/<AUTH>/${DOCKER_TOKEN}/" < "dockercfg-template" > ~/.dockercfg
- docker tag interledger/five-bells-ledger:latest interledger/five-bells-ledger:$(git describe)
- docker push interledger/five-bells-ledger:latest
- docker push interledger/five-bells-ledger:$(git describe)
general:
artifacts:
- "coverage/lcov-report"
2 changes: 1 addition & 1 deletion dockercfg-template
@@ -1 +1 @@
{"quay.io":{"auth":"<AUTH>","email":""}}
{"https://index.docker.io/v1/":{"auth":"<AUTH>","email":""}}

0 comments on commit 1468c85

Please sign in to comment.