Skip to content
This repository has been archived by the owner on Jun 6, 2018. It is now read-only.

Commit

Permalink
Merge branch 'release/v2.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
elssar committed May 28, 2016
2 parents 0b528d7 + 5bc1c54 commit 8a9ea56
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "newman-docker",
"version": "2.0.9",
"version": "2.1.0",
"description": "This repository contains the Dockerfiles and tests for the Newman Docker images.",
"scripts": {
"test": "mocha tests/*-spec.js"
Expand Down
8 changes: 4 additions & 4 deletions ubuntu_1404/Dockerfile
Expand Up @@ -10,7 +10,7 @@ RUN apt-get update && apt-get install -y \
ENV NODE_VERSION 4.3.0

# Set newman version
ENV NEWMAN_VERSION 2.0.9
ENV NEWMAN_VERSION 2.1.0

# Install node and newman
RUN npm install -g n;
Expand All @@ -31,8 +31,8 @@ WORKDIR /etc/newman
# Set newman as the default container command
# Now you can run the container via
#
# docker run -v /home/collections:/etc/newman -t newman_ubuntu1404 -c YourCollection.json.postman_collection \
# -e YourEnvironment.postman_environment \
# -H newman_report.html
# docker run -v /home/collections:/etc/newman -t postman/newman_ubuntu1404 -c YourCollection.json.postman_collection \
# -e YourEnvironment.postman_environment \
# -H newman_report.html

ENTRYPOINT ["newman"]
12 changes: 6 additions & 6 deletions ubuntu_1404/README.md
@@ -1,11 +1,11 @@
# newman_ubuntu1404

This image runs newman 2.0.9 on node 4.3.0 on Ubuntu 14.04.2
This image runs newman 2.1.0 on node 4.3.0 on Ubuntu 14.04.2

Build the image,

```terminal
docker build -t newman_ubuntu1404 .
docker build -t postman/newman_ubuntu1404 .
```

Or get it from [docker hub](https://registry.hub.docker.com/u/postman/newman_ubuntu1404/)
Expand All @@ -17,22 +17,22 @@ docker pull postman/newman_ubuntu1404:1.3.2
then run it

```terminal
docker --volume="/home/postman/collections:/etc/newman" -t newman_ubuntu1404 --collection="JSONBlobCoreAPI.json.postman_collection" --html="newman-report.html"
docker --volume="/home/postman/collections:/etc/newman" -t postman/newman_ubuntu1404 --collection="JSONBlobCoreAPI.json.postman_collection" --html="newman-report.html"
```
For newman-docker to be able to use collections and environment files saved on the host machine, and to save reports generated by newman, a directory containing the collection and environment needs to be mounted on to the docker instance on run time, preferably at `/etc/newman`, which is the default working directory. If you mount to a different location, then
- You can either pass the full path to your collection and environment files to newman. For instance, if you mount to `/var/newman`,

```terminal
docker --volume="/home/postman/collection:/var/newman" -t newman_ubuntu1404 --collection="/var/newman/JSONBlobCoreAPI.json.postman_collection" --html="/var/newman/newman-report.html"
docker --volume="/home/postman/collection:/var/newman" -t postman/newman_ubuntu1404 --collection="/var/newman/JSONBlobCoreAPI.json.postman_collection" --html="/var/newman/newman-report.html"
```
- You can change the working directory while running the image to the location you mounted to, using the `-w` or `--workdir` flag.

```terminal
docker run --volume="/home/postman/collections:/var/newman" --workdir="/var/newman" -t newman_ubuntu1404 --collection="JSONBlobCoreAPI.json.postman_collection" --html="newman-report.html"
docker run --volume="/home/postman/collections:/var/newman" --workdir="/var/newman" -t postman/newman_ubuntu1404 --collection="JSONBlobCoreAPI.json.postman_collection" --html="newman-report.html"
```

In case you don't need to save newmans report to the host, and your collection is available online and it does not require any environment, then you can forgo mounting your collections directory, and directly pass the collection url to newman

```terminal
docker run -t newman_ubuntu1404 --url="https://www.getpostman.com/collections/df0a40ef41d570c48154"
docker run -t postman/newman_ubuntu1404 --url="https://www.getpostman.com/collections/df0a40ef41d570c48154"
```

0 comments on commit 8a9ea56

Please sign in to comment.