Skip to content

Commit

Permalink
Merge pull request #113 from yohamta/docs/readme
Browse files Browse the repository at this point in the history
docs: add an example on README
  • Loading branch information
yottahmd authored May 20, 2022
2 parents ca4eefd + 47f2bf3 commit 5952d6f
Showing 1 changed file with 33 additions and 11 deletions.
44 changes: 33 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ It executes [DAGs (Directed acyclic graph)](https://en.wikipedia.org/wiki/Direct

## Contents

- [Contents](#contents)
- [Why not Airflow or Prefect?](#why-not-airflow-or-prefect)
- [️How does it work?](#️how-does-it-work)
- [Example](#example)
- [️Quick start](#️quick-start)
- [1. Installation](#1-installation)
- [2. Launch the web UI](#2-launch-the-web-ui)
Expand All @@ -24,15 +26,15 @@ It executes [DAGs (Directed acyclic graph)](https://en.wikipedia.org/wiki/Direct
- [Command Line User Interface](#command-line-user-interface)
- [Web User Interface](#web-user-interface)
- [YAML format](#yaml-format)
- [Minimal](#minimal)
- [Hello World](#hello-world)
- [Environment Variables](#environment-variables)
- [Parameters](#parameters)
- [Command Substitution](#command-substitution)
- [Conditional Logic](#conditional-logic)
- [Run Code Snippet](#run-code-snippet)
- [State Handlers](#state-handlers)
- [Output](#output)
- [Redirection](#redirection)
- [State Handlers](#state-handlers)
- [Repeating Task](#repeating-task)
- [All Available Fields](#all-available-fields)
- [Admin Configuration](#admin-configuration)
Expand All @@ -59,6 +61,25 @@ Popular workflow engines, Airflow and Prefect, are powerful and valuable tools,
- Self-contained - Single binary with no dependency, No DBMS or cloud service is required.
- Simple - It executes DAGs defined in a simple declarative YAML format. Existing programs can be used without any modification.

## Example
The below simple workflow creates and runs a sql.

```yaml
name: create and run sql
steps:

- name: create sql file
command: "bash"
script: |
echo "select * from table;" > select.sql
- name: run the sql file
command: "psql -U username -d myDataBase -a -f psql select.sql"
stdout: output.txt
depends:
- create sql file
```
## ️Quick start
### 1. Installation
Expand Down Expand Up @@ -114,22 +135,23 @@ You can execute the example by pressing the `Start` button.

## YAML format

### Minimal Example
### Hello World

```yaml
name: create and run sql
name: hello world
steps:
- name: create sql file
command: "bash"
- name: step 1
command: bash
script: |
echo "select * from table;" > select.sql
echo ${USER}
output: YOUR_NAME
- name: run the sql file
command: "psql -U username -d myDataBase -a -f psql select.sql"
stdout: output.txt
- name: step 2
command: "echo hello world, ${USER_NAME}!"
stdout: /tmp/hello-world.txt
depends:
- create sql file
- step 1
```

### Environment Variables
Expand Down

0 comments on commit 5952d6f

Please sign in to comment.