Sign inSign up

westwind027/bash

By westwind027

•Updated over 3 years ago

Image
0

551

westwind027/bash repository overview

⁠Release Note

Version 4: add helm support

Version 3: add kubectl support

Version 2: add kubekey support

Version 1: raw version

⁠bash 1.0

Ubuntu bash environment



⁠About bash

This function provides a Ubuntu 22.04 environment. The following packages are installed:

  • git
  • sed
  • wget
  • grep
  • curl
  • make
  • jq
  • openssh-client

The function can run multiple commands but if multiple commands have to be chained together or use pipes it requires a 'bash -c' command, e.g. bash -c 'cd dir && cat file.txt > newfile'

⁠Example(s)
⁠Function Configuration
functions:
- id: bash
  image: gcr.io/direktiv/functions/bash:1.0
  type: knative-workflow
⁠Basic
- id: bash
  type: action
  action:
    function: bash
    input: 
      commands:
      - command: ls -la
⁠Using ad-hoc files
- id: bash
  type: action
  action:
    function: bash
    input: 
      files:
      - name: hello.sh
        data: |-
          #!/bin/bash
          echo "Hello World"
        mode: '0755'
      commands:
      - command: ./hello.sh
⁠Return JSON file
- id: bash 
  type: action
  action:
    function: bash
    input: 
      commands:
      - command: 'bash -c "echo { \\\"hello\\\": \\\"world\\\" } > data.json"'
      - command: cat data.json
⁠Pipe
- id: bash  
  type: action
  action:
    function: bash
    input: 
      commands:
      - command: bash -c 'echo "File Data" > myfile.txt'
      - command: cat myfile.txt
⁠Secrets

No secrets required

⁠Request
⁠Request Attributes

PostParamsBody⁠

⁠Response

List of executed commands.

⁠Reponse Types

PostOKBody⁠

⁠Example Reponses
[
  {
    "result": "",
    "success": true
  },
  {
    "result": {
      "hello": "world"
    },
    "success": true
  }
]
⁠Errors
TypeDescription
io.direktiv.command.errorCommand execution failed
io.direktiv.output.errorTemplate error for output generation of the service
io.direktiv.ri.errorCan not create information object from request
⁠Types
⁠ postOKBody

Properties

NameTypeGo typeRequiredDefaultDescriptionExample
bash[]PostOKBodyBashItems⁠[]*PostOKBodyBashItems
⁠ postOKBodyBashItems

Properties

NameTypeGo typeRequiredDefaultDescriptionExample
resultinterface{}⁠interface{}✓
successbooleanbool✓
⁠ postParamsBody

Properties

NameTypeGo typeRequiredDefaultDescriptionExample
commands[]PostParamsBodyCommandsItems⁠[]*PostParamsBodyCommandsItemsArray of commands.
files[]DirektivFile⁠[]apps.DirektivFileFile to create before running commands.
⁠ postParamsBodyCommandsItems

Properties

NameTypeGo typeRequiredDefaultDescriptionExample
commandstringstringCommand to runls -la
continuebooleanboolStops excecution if command fails, otherwise proceeds with next command
envs[]PostParamsBodyCommandsItemsEnvsItems⁠[]*PostParamsBodyCommandsItemsEnvsItemsEnvironment variables set for each command.[{"name":"MYVALUE","value":"hello"}]
printbooleanbooltrueIf set to false the command will not print the full command with arguments to logs.
silentbooleanboolIf set to false the command will not print output to logs.
⁠ postParamsBodyCommandsItemsEnvsItems

Properties

NameTypeGo typeRequiredDefaultDescriptionExample
namestringstringName of the variable.
valuestringstringValue of the variable.

Tag summary

Content type

Image

Digest

sha256:168fca6fa…

Size

1.3 GB

Last updated

over 3 years ago

docker pull westwind027/bash