Sign inSign up

vorteil/ubuntu-shell

By vorteil

Updated about 5 years ago

Image
0

1.3K

vorteil/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: vorteil/ubuntu-shell:v1
  files:
    - key: "myscript"
      scope: workflow
      type: plain
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 seoncd 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

Size

145.1 MB

Last updated

about 5 years ago

docker pull vorteil/ubuntu-shell