Build and run script for docker

This commit is contained in:
moander 2015-07-09 12:33:43 +02:00
parent 80731633b4
commit 5c29cbf33d
2 changed files with 36 additions and 0 deletions

View File

@ -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:

24
run-in-docker.sh Normal file
View File

@ -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