Closed mobileskyfi closed 3 months ago
Done. Now schema building is automated. See GitHub workflows: https://github.com/tikoci/restraml/tree/main/.github/workflows
In two ways:
using-secrets
, against a real RouterOS server on internet (this uses secrets to the repo with ip/login info)using-docker-in-docker
using evilfreelancer/docker-routeros docker image (within the GItHub action via docker compose)Both have a dropdown to start a build within the workflow on GitHub Actions. Partial schema generation is support by passing the space seperated path like ip address
as the path. And resulting schemas are "published" (i.e. git add/commit/push to /docs in repo) - so they are directly downloadable from built-in Github Pages.
Should update readme and other docs... but closing.
There is no GitHub Action to automatically build the RAML schema today. While these are generally pretty trivial, the issue here is that the JavaScript code needs to have a running RouterOS to run against. GitHub Actions can easily spin up a containers, but CHR does not run in Docker. Anyway, more automated this is tricky than it would seem.
But one way to skin this cat is GH manually triggered workflow via "workflow_dispatch", instead of usual "on: push". The workflow_dispatch can take parameters. Those parameters could be the IP/user/password of a router that was setup.
See: https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch https://docs.github.com/en/webhooks/webhook-events-and-payloads#workflow_dispatch