Skip to content

Commit

Permalink
Build and run script for docker
Browse files Browse the repository at this point in the history
  • Loading branch information
moander committed Jul 9, 2015
1 parent 8073163 commit 5c29cbf
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ This is the swagger codegen project, which allows generation of client libraries

Check out [Swagger-Spec](https://github.com/swagger-api/swagger-spec) for additional information about the Swagger project, including additional libraries with support for other languages and more.

## Build and run using docker

```
git clone https://github.com/swagger-api/swagger-codegen
cd swagger-codegen
./run-in-docker.sh mvn package
./run-in-docker.sh help
```


## Compatibility
The Swagger Specification has undergone 3 revisions since initial creation in 2010. The swagger-codegen project has the following compatibilies with the swagger specification:
Expand Down
24 changes: 24 additions & 0 deletions run-in-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
set -e
cd "$(dirname $BASH_SOURCE)"

maven_cache_repo="$HOME/.m2/repository"

if [ "$1" = "mvn" ]; then
cmd="$1"
shift
args="$@"
else
cmd="java -jar /gen/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
args="$@"
fi

mkdir -p "$maven_cache_repo"

set -x

docker run -it \
-w /gen \
-v "${PWD}:/gen" \
-v "${maven_cache_repo}:/root/.m2/repository" \
maven:3-jdk-7 $cmd $args

0 comments on commit 5c29cbf

Please sign in to comment.