From 0f08dd6084256a9cb7f14e368beb49d9f369dc73 Mon Sep 17 00:00:00 2001 From: Kostia Kim Date: Tue, 14 May 2019 10:49:43 +1000 Subject: [PATCH 1/5] add dockerfile --- Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..08e542552 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM swift:5.0.1 + +WORKDIR /SwagGen +COPY . /SwagGen +RUN make install From c12269659a236404d0b868693fe6b0a3a73d88c4 Mon Sep 17 00:00:00 2001 From: Kostia Kim Date: Tue, 14 May 2019 17:35:03 +1000 Subject: [PATCH 2/5] update readme --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index e260ba28d..77662b988 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,16 @@ import SwagGenKit import Swagger ``` +## Docker + +`airtasker/swaggen` image acts as a standalone executable. It can be used as an alternative to installing via homebrew, or for developers who are unable to install Xcode. + +To generate code with this image, you'll need to mount a local location as a volume. If you want to pass Swagger spec as a file the spec needs to be inside the mounted volume. Make sure the destination is also inside the mounted volume. + +```sh +$ docker run --rm -v local_dir:/workdir airtasker/swaggen swaggen generate /workdir/api.yml --destination /workdir/generated --template Templates/Swift/template.yml +``` + ## Usage Use `--help` to see usage information From c3d5125b975a3806a5fa18eecb8cb0346bc9a38a Mon Sep 17 00:00:00 2001 From: Kostia Kim Date: Tue, 14 May 2019 17:38:08 +1000 Subject: [PATCH 3/5] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 77662b988..5489e8f61 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ import Swagger `airtasker/swaggen` image acts as a standalone executable. It can be used as an alternative to installing via homebrew, or for developers who are unable to install Xcode. -To generate code with this image, you'll need to mount a local location as a volume. If you want to pass Swagger spec as a file the spec needs to be inside the mounted volume. Make sure the destination is also inside the mounted volume. +To generate code with this image, you'll need to mount a local location as a volume. If you want to pass Swagger spec as a file it needs to be inside the mounted volume as well as the `--destination`. ```sh $ docker run --rm -v local_dir:/workdir airtasker/swaggen swaggen generate /workdir/api.yml --destination /workdir/generated --template Templates/Swift/template.yml From b3c5ea61aa1cf29eabcadf0013ec9154e4808a5a Mon Sep 17 00:00:00 2001 From: Kostia Kim Date: Tue, 14 May 2019 17:48:41 +1000 Subject: [PATCH 4/5] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5489e8f61..3be269b3d 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ import Swagger `airtasker/swaggen` image acts as a standalone executable. It can be used as an alternative to installing via homebrew, or for developers who are unable to install Xcode. -To generate code with this image, you'll need to mount a local location as a volume. If you want to pass Swagger spec as a file it needs to be inside the mounted volume as well as the `--destination`. +To generate code with this image, you'll need to mount a local location as a volume. If you want to pass Swagger spec as a file it needs to be inside the mounted volume. The output destination should also be inside the mounted volume. ```sh $ docker run --rm -v local_dir:/workdir airtasker/swaggen swaggen generate /workdir/api.yml --destination /workdir/generated --template Templates/Swift/template.yml From ab6b848243eb3b6e26e42be972a799f10178717e Mon Sep 17 00:00:00 2001 From: Kostia Kim Date: Tue, 14 May 2019 17:49:39 +1000 Subject: [PATCH 5/5] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3be269b3d..f0e673613 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ import Swagger `airtasker/swaggen` image acts as a standalone executable. It can be used as an alternative to installing via homebrew, or for developers who are unable to install Xcode. -To generate code with this image, you'll need to mount a local location as a volume. If you want to pass Swagger spec as a file it needs to be inside the mounted volume. The output destination should also be inside the mounted volume. +To generate code with this image, you'll need to mount a local location as a volume. If you want to pass Swagger spec as a file it needs to be inside the mounted volume. Custom templates and the output destination should also be inside the mounted volume. ```sh $ docker run --rm -v local_dir:/workdir airtasker/swaggen swaggen generate /workdir/api.yml --destination /workdir/generated --template Templates/Swift/template.yml