Skip to content

Commit

Permalink
1. Step can pass results of command to another step #96
Browse files Browse the repository at this point in the history
2. Adding empty steps will break worker #97
  • Loading branch information
kilgaloon committed Jul 9, 2019
2 parents 974f79b + a6c59cf commit 133253d
Show file tree
Hide file tree
Showing 11 changed files with 4,141 additions and 18 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@



Current Version: **1.1.0**
Current Version: **1.2.0**

Current Release: **Calimero**

Expand Down Expand Up @@ -101,6 +101,22 @@ but in this case for example first task will block performing on any task and al
- ping google.com
- -> echo "I need to wait above step to finish, then i can do my stuff"

## Step Pipe

Output from one step can be passed to input of next step:

name: job1 // name of recipe
definition: schedule
schedule:
min: 0 // every min
hour: 0 // every hour
day: 0 // every day
steps: // steps are done from first to last
- echo "Pipe this to next step" }>
- cat > piped.txt

As you see, first step is using syntax `}>` at the end, which tells that this command output will be passed to next command input, you can chain like this how much you want.
Although this is perfectly fine syntax for step `-> echo "Pipe this to next step" }>` (we added async syntax), next step will start even before first step finished and basically nothing will be piped.

## Installation

Expand Down
4 changes: 2 additions & 2 deletions client/queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ func TestBuildQueue(t *testing.T) {
Agent.BuildQueue()

Agent.Lock()
if len(Agent.Queue.Stack) != 5 {
t.Errorf("Queue stack length expected to be 5, got %d", len(Agent.Queue.Stack))
if len(Agent.Queue.Stack) != 6 {
t.Errorf("Queue stack length expected to be 6, got %d", len(Agent.Queue.Stack))
}
Agent.Unlock()

Expand Down
2 changes: 1 addition & 1 deletion dist/configs/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# we are using this just to fix bugs in advance
# if you don't want to share this data
# set it to true
daemon.error_reporting = true
daemon.error_reporting = false
# we want to log our errors, and specify where
error_log = var/log/leprechaun/error.log
# we want to log our info about app to know whats going on
Expand Down
10 changes: 10 additions & 0 deletions dist/recipes/job4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: job4 # name of recipe
definition: schedule
schedule:
min: 0
hour: 0
day: 0

steps: # steps are done from first to last
- echo "I like golang" }>
- cat > i_like_it.txt
1 change: 1 addition & 0 deletions tests/configs/config_global_fb.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
error_reporting = false
# we want to log our errors, and specify where
error_log = ../tests/var/log/leprechaun/error.log
# we want to log our info about app to know whats going on
Expand Down
2 changes: 2 additions & 0 deletions tests/configs/config_regular.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
daemon.error_reporting = false

# we want to log our errors, and specify where
test.error_log = ../tests/var/log/leprechaun/error.log
# we want to log our info about app to know whats going on
Expand Down
578 changes: 578 additions & 0 deletions tests/var/log/leprechaun/error.log

Large diffs are not rendered by default.

Loading

0 comments on commit 133253d

Please sign in to comment.