-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This makes a pass over the entire repository to clean it up a bit so that we can comfortably publish it.
- Loading branch information
1 parent
f240833
commit e4c5adc
Showing
12 changed files
with
46 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.DS_Store | ||
/.git/ | ||
/Dockerfile | ||
/LICENSE | ||
/README.md | ||
/docker-compose.yaml | ||
/integration/data/reference/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,20 @@ | ||
ARG TENZIR_VERSION=main | ||
FROM ghcr.io/tenzir/tenzir-dev:${TENZIR_VERSION} AS example-builder-untested | ||
FROM ghcr.io/tenzir/tenzir-dev:${TENZIR_VERSION} AS example-builder | ||
|
||
COPY example /plugins/example | ||
COPY . /plugins/example/ | ||
|
||
RUN cmake -S /plugins/example -B build-example -G Ninja -D CMAKE_INSTALL_PREFIX:STRING="$PREFIX" | ||
RUN cmake --build build-example --parallel | ||
RUN cmake --install build-example --strip --component Runtime --prefix /plugin/example | ||
|
||
FROM example-builder-untested AS example-test | ||
FROM example-builder AS example-test | ||
|
||
ENV BATS_LIB_PATH=/tmp/tenzir/tenzir/integration/lib | ||
# TODO: Use the update-integration target instead | ||
ENV UPDATE=1 | ||
|
||
ENTRYPOINT cmake --build build-example --target integration | ||
|
||
FROM example-builder-untested AS example-builder | ||
|
||
ENV BATS_LIB_PATH=/tmp/tenzir/tenzir/integration/lib | ||
RUN cmake --build build-example --target integration | ||
|
||
FROM ghcr.io/tenzir/tenzir:${TENZIR_VERSION} | ||
|
||
COPY --from=example-builder --chown=tenzir:tenzir /plugin/example /opt/tenzir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,42 @@ | ||
# Tenzir Example Plugin | ||
|
||
This is an example plugin for Tenzir. Simply run `docker compose up` to build | ||
and start a Tenzir node with your additional plugin. Use `docker compose run | ||
tenzir '<pipeline>'` to interact with the node, or set the following | ||
environment variables and to connect your node to app.tenzir.com: | ||
This is an example plugin for Tenzir. | ||
|
||
## Build and run | ||
|
||
Simply run `docker compose up` to build and start a Tenzir node with your | ||
additional plugin. | ||
|
||
Use `docker compose run tenzir '<pipeline>'` to interact with the node. Set the | ||
following environment variables and to connect your node to app.tenzir.com: | ||
|
||
``` | ||
export TENZIR_PLUGINS__PLATFORM__API_KEY='<api-key>' | ||
export TENZIR_PLUGINS__PLATFORM__TENANT_ID='<tenant-id>' | ||
``` | ||
|
||
## Write Tests | ||
## Learn how to write a plugin | ||
|
||
We think that learning how to build a plugin is best done by example. Tenzir | ||
ships with a variety of [plugins][plugins-source] and | ||
[builtins][builtins-source] to get inspired by and to learn from. | ||
|
||
If you have any questions, feel free to reach out in the [#developers channel | ||
on Discord][discord]. | ||
|
||
## Run tests | ||
|
||
Every plugin defines additional tests using | ||
[BATS](https://bats-core.readthedocs.io/en/stable/writing-tests.html). Use | ||
`docker compose run tests` to execute your tests and update the reference files | ||
automatically. | ||
`docker compose run --build tests` to execute your tests and update the | ||
reference files automatically. | ||
|
||
## Contribute your plugin | ||
|
||
If you want to upstream your plugin so that it is bundled with every Tenzir | ||
installation, open a PR that adds it to the [`plugins/` directory in the | ||
`tenzir/tenzir` repository][plugins-source]. | ||
|
||
[plugins-source]: https://github.com/tenzir/tenzir/tree/main/plugins | ||
[builtins-source]: https://github.com/tenzir/tenzir/tree/main/libtenzir/builtins | ||
[discord]: https://docs.tenzir.com/discord |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
example/integration/data/reference/tests/test_check_plugin_availability/step_00.ref
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
integration/data/reference/tests/test_check_plugin_availability/step_00.ref
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"name": "example", "types": ["operator"], "dependencies": []} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.