Skip to content

Commit 3233e0d

Browse files
committed
build: update run scripts for Docker
1 parent 577e434 commit 3233e0d

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ node_js:
1010
- "node"
1111

1212
before_script:
13-
- npm run build-image
14-
- npm run start-container
13+
- npm run bootstrap-container
1514
- sleep 10
1615

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

2019
after_script:
21-
- npm run stop-container
20+
- npm run remove-container

HOW_TO_CONTRIBUTE.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ It is recommended that you not use a RabbitMQ server running outside Docker as f
1515

1616
#### Included Docker Container
1717

18-
The repo includes a Dockerfile as well as npm commands to build, start and stop the container:
19-
20-
* `npm run build-image`
21-
* `npm run start-container`
22-
* `npm run stop-container`
18+
The repo includes a Dockerfile as well as npm commands to build, start and stop and remove the container:
19+
20+
* `npm run build-image` - build Docker image (includes plugins needed for rabbot)
21+
* `npm run create-container` - creates a container named `rabbot` for tests
22+
* `npm run start-container` - starts the container if it was stopped
23+
* `npm run stop-container` - stops the container only
24+
* `npm run remove-container` - stops and removes the container entirely
25+
* `npm run bootstrap-container` - combines `build-container` & `create-container`
2326

2427
### A Note About Features or Big Refactors
2528

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@
1515
"coverage": "nyc npm test",
1616
"release": "standard-version",
1717
"build-image": "docker build -t rabbot .",
18-
"start-container": "docker run -d --name rabbot -p 15672:15672 -p 5672:5672 rabbot",
19-
"stop-container": "docker kill rabbot && docker container rm rabbot"
18+
"create-container": "docker run -d --name rabbot -p 15672:15672 -p 5672:5672 rabbot",
19+
"bootstrap-container": "npm run build-image && npm run create-container",
20+
"start-container": "docker start rabbot",
21+
"stop-container": "docker stop rabbot",
22+
"remove-container": "docker rm -f rabbot"
2023
},
2124
"publishConfig": {
2225
"registry": "https://registry.npmjs.org/"

0 commit comments

Comments
 (0)