otto/stdlib/echo
R Tyler Croy c11c05aac0 Relocate the primitive agent into the agent directory and wire in block scoped steps for the dir step
This was WAY EASIER than I thought it would be, which has me extra pumped about
this design decision.

The pipeline.yml sent to the agent:

  ---
  steps:
    - symbol: sh
      parameters:
        script: 'ls -lah | tail -n 5'

    - symbol: sh
      parameters:
        script: 'echo "Hello world from a script"'

    - symbol: dir
      parameters:
        directory: 'stdlib'
        block:
          - symbol: sh
            parameters:
              script: 'pwd && ls -lah'
          - symbol: echo
            parameters:
              message: 'Hello from a block-scoped step!'

    - symbol: unknown
      parameters:
        message: 'this should fail'

Then executing it in the tree:

  ❯ STEPS_DIR=$PWD/tmp ./target/debug/otto-agent ./test-pipeline.yml
  sh exists
  sh exists
  dir exists
  unknown/manifest.yml does not exist, step cannot execute
  NORMALLY THIS WOULD ERROR BEFORE ANYTHING EXECUTES
  ---
  -rw-r--r--  1 tyler users 1.1K Feb 20  2020 system.dot
  -rw-r--r--  1 tyler users  43K Feb 20  2020 system.png
  drwxr-xr-x  7 tyler users 4.0K Oct 17 15:25 target
  -rw-r--r--  1 tyler users 1.5K Oct 22 20:38 test-pipeline.yml
  drwxr-xr-x  5 tyler users 4.0K Oct 22 20:35 tmp
  Hello world from a script
  sh exists
  echo exists
  ---
  /home/tyler/source/git/otto/stdlib
  total 20K
  drwxr-xr-x  5 tyler users 4.0K Oct 22 20:02 .
  drwxr-xr-x 22 tyler users 4.0K Oct 22 20:38 ..
  drwxr-xr-x  4 tyler users 4.0K Oct 22 20:19 dir
  drwxr-xr-x  2 tyler users 4.0K Oct 22 20:28 echo
  drwxr-xr-x  4 tyler users 4.0K Oct 21 19:40 sh
  Hello from a block-scoped step!

Voila!
2020-10-22 20:35:49 -07:00
..
README.adoc Add the echo step, which is a primitive example of a multiarch step library 2020-10-18 13:37:44 -07:00
echo-step Relocate the primitive agent into the agent directory and wire in block scoped steps for the dir step 2020-10-22 20:35:49 -07:00
manifest.yml Add the echo step, which is a primitive example of a multiarch step library 2020-10-18 13:37:44 -07:00

README.adoc

<html lang="en"> <head> </head>

echo step

The echo step is a simple step that just echoes a string into the log.

Note

This is currently not cross-platform to explicitly provide a step to test multiarch step libraries

</html>