Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Let's restart the discussion around docker image support. This aim to replace #163 and add support for docker for this projet.
Why
After almost a year of working with Swaggen in a Docker container I do prefer this workflow. Because it guarantees that it is working the same way as your CI is working or if your backend dev are on Linux it works for them to too test if they didn't break your library. With one script anyone(back/front end dev) in the team can generate a custom version of the library. It's easier to maintain and update.
The generated images are 77mb of size and have everything required for swift and swaggen to work.
How to use the generated image
When to update it
You will need to update the Swaggen image for every new Swift build. But luckily it's a script to run with nothing to change in it and it will create/tag/publish everything.
Change description
getLastSwiftTag.swift is a script that look for all the tag of a repo then search the one that match the pattern given in parameter(version of the Swift Toolchains for Linux released) then sort then and take the one with the bigger version number.
updateDockerImage.sh is the main script here it goal is to generate a new docker image base from the official swift docker image but it add swaggen to it. It designed to be run every time a new version of swift is available publicly or for every new version of Swaggen. It build tag test and push the image to docker hub. The way the script is done allow for easy customization it's pretty easy to build a docker image for a branch of a repo. I'm not great a shell script but it is doing the job pretty well.
Docker.md aims to the be central documentation point for docker matter.
Dockerfile is the recipe used to build the docker images it based on mithun work on the matter.
The way updateDockerImage.sh is written allow you to use it in other place pretty easily.
Todo for the maintainer
In order for all of this to work @yonaskolb you have to make an account with yonaskolb username and create the project swaggen on it on https://hub.docker.com it's free for public docker image. Once it done please update the top of updateDockerImage.sh with what you chose as login and project. Then just run it.
Other people do the same
OpenAPI provide a Docker image for their generator.
I hope it helps.