forked from loafle/openapi-generator-original
Build and run script for docker
This commit is contained in:
parent
80731633b4
commit
5c29cbf33d
12
README.md
12
README.md
@ -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.
|
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
|
## 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:
|
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
24
run-in-docker.sh
Normal 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
|
Loading…
x
Reference in New Issue
Block a user