Adds changes to Tayori's inbox (Tayori.Inbox), in two ways.
In the app, with its database: it starts the app and reads every source
of the :inbox config, as Tayori.Inbox.ingest/0 does.
$ mix tayori.ingest
From CI, to an app that runs elsewhere: it reads a changelog and a
folder of fragments here, and sends their changes to the app's
POST /changes (Tayori.Ingest). It does not start the app, and needs
no database.
$ mix tayori.ingest --url https://myapp.com/api/machines/news \
--token "$TAYORI_INGEST_TOKEN" \
--changelog CHANGELOG.md --fragments priv/news
Options of the second way:
--url- the address of the JSON API mounted for machines.--token- the ingest token (else theTAYORI_INGEST_TOKENenvironment variable).--changelog- a Keep a Changelog file (Tayori.Sources.Changelog).--fragments- a folder of fragments (Tayori.Sources.Fragments);--recursivereads the folders inside it too.--source- the source of every change sent ("changelog"and"fragments", as the sources of the config name theirs).
It sends 500 changes a request at most, and needs the :req
dependency. It prints how many were new, and fails when a request
fails or a change is invalid.
In a release, with no Mix, the first way is to ask the running app:
bin/my_app rpc "IO.inspect(Tayori.Inbox.ingest())". Not eval, whose
node does not start the app.