Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from postfinance/feature/project-updates
Browse files Browse the repository at this point in the history
project updates
  • Loading branch information
bbortt authored Feb 16, 2022
2 parents 14f1f01 + eda255d commit 34ed0be
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 7 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
- package-ecosystem: 'docker'
directory: '/'
schedule:
interval: 'weekly'
6 changes: 5 additions & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Developer Instructions

Contents:

* [Automatic Versioning](#automatic-versioning)

# Automatic Versioning
## Automatic Versioning

The automatic versioning happens in the [build action](https://github.com/postfinance/polling-swagger-ui/actions)
according to SemVer. It uses the [`docker/metadata-action`](https://github.com/docker/metadata-action#semver):
Expand Down
12 changes: 8 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
FROM swaggerapi/swagger-ui:v3.52.2
FROM swaggerapi/swagger-ui:v4.5.0
MAINTAINER OpenSource PF <[email protected]>

ENV CONFIG_URL /apis/swagger-config.json
ENV SWAGGER_ROOT /usr/share/nginx/html/apis

CMD ["sh", "/polling-entrypoint.sh"]
CMD ["sh", "/appl/polling-swagger-ui/entrypoint.sh"]

EXPOSE 8080

COPY scripts/entrypoint.sh /polling-entrypoint.sh
COPY scripts/poll.js /poll.js
RUN \
mkdir -p /appl/polling-swagger-ui

COPY scripts/entrypoint.sh /appl/polling-swagger-ui/entrypoint.sh
COPY scripts/poll.js /appl/polling-swagger-ui/poll.js
COPY scripts/poll-monitor.sh /appl/polling-swagger-ui/poll-monitor.sh
3 changes: 1 addition & 2 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
# Docker entrypoint starting nginx as well as the polling process.
# Original CMD ["sh", "/usr/share/nginx/run.sh"]: https://github.com/swagger-api/swagger-ui/blob/master/Dockerfile.

#/poll.sh & /docker-entrypoint.sh sh /usr/share/nginx/run.sh
node /poll.js & /docker-entrypoint.sh sh /usr/share/nginx/run.sh
/appl/polling-swagger-ui/poll-monitor.sh & /docker-entrypoint.sh sh /usr/share/nginx/run.sh
8 changes: 8 additions & 0 deletions scripts/poll-monitor.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env sh
#
# Monitors the polling process, restarts it if it dies.

until $(node /appl/polling-swagger-ui/poll.js >&2); do
echo "Polling process died with exit code $?. Respawning.." >&2
sleep 1
done

0 comments on commit 34ed0be

Please sign in to comment.