September 2018
Intermediate to advanced
764 pages
20h 6m
English
To replace the demo URL, we are going to use a Bash script that will use environment variables to compose the URL of our openapi.yaml, and then substitute it in using sed. However, the SERVER_* environment variables we have set are internal, and won't be valid for our clients. Therefore, we need to add three more environment variables to hold the external URL of our API server.
In envs/.env and envs/.env.example, add the following three environment variables:
SERVER_EXTERNAL_PROTOCOL=httpSERVER_EXTERNAL_HOSTNAME=api.hobnob.jenkinsSERVER_EXTERNAL_PORT=80
Then, create a new file at scripts/swagger-ui/format.sh with execute permissions and paste in the following script:
#!/usr/bin/env bashsed -i "s!https://petstore.swagger.io/v2/swagger.json! ...
Read now
Unlock full access