What it does

This action executes Shell commands run locally against the pipeline’s filesystem. It’s like Terminal on Mac and Linux or Command Prompt on Windows.

How it works

The action launches a Docker container in which it runs the provided commands. It’s possible to select /bin/sh or /bin/bash. By default the action uses the official Docker image from the Docker Hub, but it can be changed to anything else.

Good to know

  • The field supports multiple commands (one per line), piping commands together, or splitting a single command into multiple lines with \ (backslash) at the end of each line
  • By default, commands are run in the filesystem mounted to the pipeline (working directory)
  • The result of the action execution, like generated files (artifacts), is saved to the pipeline filesystem and can be processed or deployed by another action
  • Everything saved to the default working directory remains in the pipeline filesystem and is available for other actions and between executions
  • All files & directories created outside the default working directory of the launched container are lost when the execution ends. To keep the data between executions, list them in the Additional Cache section of the Cache tab
  • If you need to preinstall packages before running your commands, you can put them in the Customize Environment section of the Environment tab. The commands listed there will be executed only once and cached between executions by default
  • On each pipeline execution, a git fetch request is executed and the pipeline's filesystem is populated with the Git repository content. If a pipeline was executed with the Clear cache before running flag, git clone will be used instead
  • You can upload static and configuration files that you don't want to store in the repository to the filesystem. They will remain in the filesystem and will not be deleted even if the pipeline is run with the clear cache option
  • If the Latest tag is used, Buddy will pull the newest version of the Docker image from the registry on each execution (provided it exists)
  • The action is marked as failed when a command exits with a non-zero value
  • All build commands set on the Run tab are run as the default user defined in the selected Docker image. If you want, you can define a different user in the Environment tab

Action preview


Local Shell Action Features

  • You can attach services and databases with a single click in the Services tab
  • Supported services: Cassandra, Elastic, MariaDB, Memcached, MongoDB, MySQL, Postgres, RabbitMQ, Redis, Selenium Chrome & Selenium Firefox
  • It is also possible to use your own custom services using a Docker image built by a previous action
  • All services are cacheable
  • For database-like services (MySQL, MariaDB, Postgres, etc.) it is possible to set a default database and populate the databases using a seed file
  • You can use your own Docker image from the Docker Hub Private and Docker Hub Public, Amazon ECR, Google GCR, or any other private or public Docker repository
  • It is also possible to use custom images created with the Build Docker image action in previous steps of the pipeline
  • Caching files & directories that are required by your commands on every run speeds up executions (Cache tab)
  • Both shell (SH) and Bourne shell (BASH) are supported
  • The action supports Environment variables which could be used in build commands (Run tab) and for Cache
  • It is possible to specify conditions under which the action will be executed (always, on changes in the repository since the last run, on changes in specific paths in the repository, or when a Variable has a specific value)
  • Can be triggered manually, recurrently or on every push to GitHub, GitLab, Bitbucket & any other Git repository
  • Advanced pipeline triggers: tag, pull request, and push to branch (wildcards supported
  • Exit code handling: you can either stop the commands if any of them throws an error or run the following commands regardless of the result ot previous commands
  • Error handling: you can either stop the execution, mark action and pipeline as failed or proceed the execution, mark action as warning and jump to the next action
Local Shell

Do more with Local Shell

Buddy allows you to instantly connect Local Shell with 100+ actions to automate your development and build better apps faster.

1 - 9 (of 149)