Skip to content

Commit

Permalink
Add cleanup-step example and README
Browse files Browse the repository at this point in the history
Authored-by: Jayson Grace <jayson.e.grace@gmail.com>
  • Loading branch information
l50 committed Sep 20, 2023
1 parent cb068b3 commit 46968e5
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
37 changes: 37 additions & 0 deletions ttps/examples/steps/cleanup-step/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# File Creation and Cleanup using `test-cleanup` Step

Discover how to create and subsequently clean up files leveraging the
`test-cleanup` step. This example showcases the capability to create a
directory and remove it in the cleanup step.

---

## Running `cleanup-step.yaml` Demonstration

Execute the following command to illustrate the functionality of
the `test-cleanup` step:

```bash
ttpforge run forgearmory//examples/steps/cleanup-step/cleanup-step.yaml
```

---

## Expected Output

```text
INFO [*] Validating Steps
INFO [+] Finished validating steps
INFO [+] Running current TTP: test-cleanup
INFO [+] Running current step: step_one
INFO ========= Executing ==========
# Directory "testDir" is created here
INFO ========= Done ==========
INFO [+] Finished running step: step_one
INFO [*] Completed TTP
INFO [*] Starting Cleanup
INFO ========= Executing ==========
# Directory "testDir" is removed here
INFO ========= Done ==========
INFO [*] Cleanup Complete
```
7 changes: 7 additions & 0 deletions ttps/examples/steps/cleanup-step/cleanup-step.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: test-cleanup
steps:
- name: step_one
inline: mkdir testDir
cleanup:
inline: rm -rf testDir

0 comments on commit 46968e5

Please sign in to comment.