Sign inSign up

westwind027/ubuntu-shell

By westwind027

•Updated about 4 years ago

Image
0

300

westwind027/ubuntu-shell repository overview

⁠Request

Executing shell scripts on Ubuntu

⁠Direktiv

An example workflow of using the container in a workflow on Direktiv.

id: shell
functions:
- id: myshell
  image: direktiv/ubuntu-shell:v3
states:
- id: hello
  type: action
  action:
    function: shell
    input:
      script: "myscript"
      args: 
        - "arg1"
        - "arg2"

⁠Input

The action takes two parameters. The first one is 'script' which is a name of a variable containing the script. Usually it comes from a workflow-scoped variable. The second is an array of arguments for the script. The environment variable 'Direktiv_TempDir' is set for the script.

⁠Output

The action returns either JSON with an output of the shell script or a valid JSON if the script return valid json.

⁠Output return
#!/bin/bash

ls -la
pwd
{
  "output": "output of the shell script\n"
}
⁠JSON return
#!/bin/bash

echo direktiv > /dev/null
echo '{ "direktiv":"'"$1"'" }'
{
  "direktiv": "arg"
}

⁠Error

In the case that an error is encountered, it will present in the following format:

{
    "errorCode": "com.ubuntu.error",
    "errorMsg": "Something went wrong"
}

Tag summary

Content type

Image

Digest

sha256:dbe413a67…

Size

321.1 MB

Last updated

about 4 years ago

docker pull westwind027/ubuntu-shell