2020-01-12 21:22:06 +00:00
|
|
|
= IRC push function
|
|
|
|
|
2020-01-12 21:30:28 +00:00
|
|
|
This is an
|
|
|
|
link:https://github.com/peterhuene/azure-functions-rs/[Azure Function]
|
|
|
|
which implements a simple dispatch of push events into a pre-defined IRC channel.
|
|
|
|
|
|
|
|
|
2020-01-12 21:22:06 +00:00
|
|
|
== Development
|
|
|
|
|
2020-01-12 21:30:28 +00:00
|
|
|
Running the unit test(s) can be done with: `cargo test`
|
|
|
|
|
2020-01-12 21:22:06 +00:00
|
|
|
=== Local invocations
|
|
|
|
|
2020-01-12 21:30:28 +00:00
|
|
|
Running locally will first require the prerequisites for the azure-functions-rs
|
|
|
|
crate to be installed, which is described
|
|
|
|
link:https://github.com/peterhuene/azure-functions-rs/#installation[in this document].
|
|
|
|
|
|
|
|
Once the prerequisites have been met, hosting the function locally requires an
|
|
|
|
invocation of the new `cargo func` command: `cargo func run --port 8100`
|
|
|
|
|
|
|
|
.Sending test data
|
2020-01-12 21:32:25 +00:00
|
|
|
[source,sh]
|
2020-01-12 21:22:06 +00:00
|
|
|
----
|
|
|
|
curl -XPOST --data @events.push.json http://localhost:8100/api/webhook
|
|
|
|
----
|
|
|
|
|
|
|
|
=== Deployment
|
|
|
|
|
2020-01-12 21:30:28 +00:00
|
|
|
The following is an example of the deployment to an Azure Container Registry configured by
|
|
|
|
link:https://github.com/rtyler[rtyler].
|
|
|
|
|
|
|
|
If you wish to deploy this yourself, you will need to configure an Azure
|
|
|
|
Functions App (Classic) and your own registry.
|
|
|
|
|
2020-01-12 21:32:25 +00:00
|
|
|
[source,sh]
|
2020-01-12 21:22:06 +00:00
|
|
|
----
|
|
|
|
docker build -t functionsbrokencode.azurecr.io/irc-push . && docker push functionsbrokencode.azurecr.io/irc-push
|
|
|
|
----
|