Skip to content

Commit

Permalink
Add plugin docs and refactor menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Castell committed Jan 21, 2019
1 parent 17a973e commit 7535024
Show file tree
Hide file tree
Showing 14 changed files with 177 additions and 37 deletions.
4 changes: 2 additions & 2 deletions website/content/pro/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Authentication can be set using these parameters in the dkron config file:

```yaml
# dkron.yml
username: foo
password: bar
username: dkron_admin
password: adminpassword
```
This will enable auth on the WebUI and for the API.
3 changes: 3 additions & 0 deletions website/content/pro/executors/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: Executors
---
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions website/content/pro/processors/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Processors
---

{{% children style="h3" description="true" %}}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Executors
weight: 2
weight: 30
---

## Executors
Expand All @@ -13,15 +13,4 @@ New plugins will be added, or you can create new ones, to perform different task

[Dkron Pro](/products/pro/) have commercially supported executors

Add this to a job definition to use the `shell` executor:

```json
{
"executor": "shell",
"executor_config": {
"command": "echo \"Hello from dkron\""
}
}
```

Refer to the API documentation for [params accepted by the `shell` executor](/usage/api/#executor-shell).
{{% children %}}
38 changes: 38 additions & 0 deletions website/content/usage/executors/http.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: HTTP Executor
---

HTTP executor can send a request to an HTTP endpoint

## Configuration

Params:

```
method: Request method in uppercase
url: Request url
headers: Json string, such as "[\"Content-Type: application/json\"]"
body: POST body
timeout: Request timeout, unit seconds
expectCode: Expect response code, such as 200,206
expectBody: Expect response body, support regexp, such as /success/
debug: Debug option, will log everything when this option is not empty
```

Example

```json
{
"executor": "http",
"executor_config": {
"method": "GET",
"url": "http://example.com",
"headers": "[]",
"body": "",
"timeout": "30",
"expectCode": "200",
"expectBody": "",
"debug": "true"
}
}
```
31 changes: 31 additions & 0 deletions website/content/usage/executors/shell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

---
title: Shell Executor
---

Shell executor run a system command

## Configuration

Params

```
shell: Run this command using a shell environment
command: The command to run
env: Env vars separated by comma
cwd: Chdir before command run
```

Example

```json
{
"executor": "shell",
"executor_config": {
"shell": "true",
"command": "my_command",
"env": "ENV_VAR=va1,ANOTHER_ENV_VAR=var2",
"cwd": "/app"
}
}
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Execution Processors
weight: 2
title: Processors
weight: 30
---

## Execution Processors
Expand Down Expand Up @@ -28,23 +28,4 @@ Dkron provides the following built-in processors:

All plugins accepts one configuration option: `forward` Indicated if the plugin must forward the original execution output. This allows for chaining plugins and sending output to different targets at the same time.

You can set more than one processor to a job. For example:

```
{
"name": "job_name",
"command": "/bin/true",
"schedule": "@every 2m",
"tags": {
"role": "web"
},
"processors": {
"files": {
"forward": true
},
"syslog": {
"forward": true
},
}
}
```
{{% children %}}
33 changes: 33 additions & 0 deletions website/content/usage/processors/file.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: File Processor
---

File processor saves the execution output to a single log file in the specified directory

## Configuration

Parameters

```
log_dir: Path to the location where the log files will be saved
forward: Forward log output to the next processor
```

Example

```
{
"name": "job_name",
"command": "echo 'Hello files'",
"schedule": "@every 2m",
"tags": {
"role": "web"
},
"processors": {
"files": {
"log_dir": "/var/log/mydir",
"forward": true
}
}
}
```
29 changes: 29 additions & 0 deletions website/content/usage/processors/log.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Log Processor
---

Log processor writes the execution output to stdout/stderr

## Configuration

Parameters

`forward: Forward the output to the next processor`

Example

```
{
"name": "job_name",
"command": "echo 'Hello log'",
"schedule": "@every 2m",
"tags": {
"role": "web"
},
"processors": {
"log": {
"forward": true
}
}
}
```
31 changes: 31 additions & 0 deletions website/content/usage/processors/syslog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: Syslog Processor
---

Syslog processor writes the execution output to the system syslog daemon

Note: Only work on linux systems

## Configuration

Parameters

`forward: Forward the output to the next processor`

Example

```
{
"name": "job_name",
"command": "echo 'Hello syslog'",
"schedule": "@every 2m",
"tags": {
"role": "web"
},
"processors": {
"syslog": {
"forward": true
}
}
}
```

0 comments on commit 7535024

Please sign in to comment.