Skip to content

Commit

Permalink
build: update run scripts for Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
arobson committed Feb 18, 2018
1 parent 577e434 commit 3233e0d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ node_js:
- "node"

before_script:
- npm run build-image
- npm run start-container
- npm run bootstrap-container
- sleep 10

script:
- nyc npm test && nyc report --reporter=text-lcov | coveralls

after_script:
- npm run stop-container
- npm run remove-container
13 changes: 8 additions & 5 deletions HOW_TO_CONTRIBUTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ It is recommended that you not use a RabbitMQ server running outside Docker as f

#### Included Docker Container

The repo includes a Dockerfile as well as npm commands to build, start and stop the container:

* `npm run build-image`
* `npm run start-container`
* `npm run stop-container`
The repo includes a Dockerfile as well as npm commands to build, start and stop and remove the container:

* `npm run build-image` - build Docker image (includes plugins needed for rabbot)
* `npm run create-container` - creates a container named `rabbot` for tests
* `npm run start-container` - starts the container if it was stopped
* `npm run stop-container` - stops the container only
* `npm run remove-container` - stops and removes the container entirely
* `npm run bootstrap-container` - combines `build-container` & `create-container`

### A Note About Features or Big Refactors

Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
"coverage": "nyc npm test",
"release": "standard-version",
"build-image": "docker build -t rabbot .",
"start-container": "docker run -d --name rabbot -p 15672:15672 -p 5672:5672 rabbot",
"stop-container": "docker kill rabbot && docker container rm rabbot"
"create-container": "docker run -d --name rabbot -p 15672:15672 -p 5672:5672 rabbot",
"bootstrap-container": "npm run build-image && npm run create-container",
"start-container": "docker start rabbot",
"stop-container": "docker stop rabbot",
"remove-container": "docker rm -f rabbot"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/"
Expand Down

0 comments on commit 3233e0d

Please sign in to comment.