syncthing-events/devfile.yaml
Emil Lerch a584d3ed46
add AI generated whatever
I want a cli application written in zig 0.14.0 that continuously polls a syncthing events url (http://localhost:8384/rest/events?events=ItemFinished) by default. Syncthing uses the id in the json output to track the last event, so it will need to handle "since=<id>" in the query string after the first request. For all items returned, it should check all the events to see if they match anything configured by the user (the config file can be json, zon, or yaml format). The configuration must allow specification of the folder and path regular expression. If an event matches one of the configured items, the configuration will specify a system command that will be run synchronously, using stdout and stderr of the process. Tests should be written to verify accuracy of the parsing logic for both configuration and events, and the README must document the application. Also, please create a devfile.yaml for future use.
2025-03-31 16:54:36 -07:00

49 lines
No EOL
1.3 KiB
YAML

schemaVersion: 2.2.0
metadata:
name: syncthing-events-handler
version: 1.0.0
displayName: Syncthing Events Handler
description: A Zig application that monitors Syncthing events and executes configured actions
language: zig
projectType: zig
components:
- name: zig-dev
container:
image: hexpm/elixir:1.15.4-erlang-26.0.2-debian-bullseye-20230612-slim
memoryLimit: 2Gi
mountSources: true
command: ['tail', '-f', '/dev/null']
env:
- name: ZIG_VERSION
value: "0.14.0"
commands:
- id: download-zig
exec:
component: zig-dev
commandLine: |
curl -L https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz -o zig.tar.xz && \
tar xf zig.tar.xz && \
mv zig-linux-x86_64-${ZIG_VERSION} /usr/local/zig && \
rm zig.tar.xz && \
ln -s /usr/local/zig/zig /usr/local/bin/zig
workingDir: ${PROJECT_SOURCE}
- id: build
exec:
component: zig-dev
commandLine: zig build
workingDir: ${PROJECT_SOURCE}
- id: test
exec:
component: zig-dev
commandLine: zig build test
workingDir: ${PROJECT_SOURCE}
- id: run
exec:
component: zig-dev
commandLine: zig build run
workingDir: ${PROJECT_SOURCE}