Skip to content
This repository has been archived by the owner on Sep 29, 2021. It is now read-only.

Commit

Permalink
docs: add an example
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Oct 15, 2020
1 parent a28a515 commit 3df72c7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
4 changes: 2 additions & 2 deletions examples/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ func TestBuildflow(t *testing.T) { //nolint:funlen
file: "task_dependency.yaml",
},
{
title: "task.when is true",
file: "task_when_true.yaml",
title: "task.when",
file: "task_when.yaml",
},
{
title: "read_file",
Expand Down
17 changes: 17 additions & 0 deletions examples/task_when.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
phases:
- name: main
tasks:
- name: "when true"
command:
command: echo "when is always true"
when: true
- name: when
command:
command: echo "use Tengo script in when"
when: |
// Tengo script
// Define the variable "result" and this value should be true or false.
result := func(task) {
return task.Name == "when"
}(Task)
8 changes: 0 additions & 8 deletions examples/task_when_true.yaml

This file was deleted.

0 comments on commit 3df72c7

Please sign in to comment.