The Probo.CI Script plugin is very similar to the Shell plugin but is designed to run multiple lines of commands.

Instead of command, the Probo Script plugin requires a parameter for script. This allows you to define a set of Shell commands to run during the Probo Build process for your site. You can list as many commands as you like within the steps in your .probo.yaml file. Remember to include a name for each script.

Probo Script Plugin Examples

Using the Probo Script plugin

Add your script as a multi-line YAML string.

steps:
  - name: List Pull Request files
    plugin: Script
    script: |
      cd $SRC_DIR
      files=$(ls)
      echo "Listing all files included in this Pull Request..."
      echo files $files

You can also add your script in the traditional YAML syntax. Each new line in your script is a new item in the sequence.

steps:
  - name: List Pull Request files
    plugin: Script
    script:
      - cd $SRC_DIR
      - files=$(ls)
      - echo "Listing all files included in this Pull Request..."
      - echo files $files

Currently a Probo Build Step will pass or fail based on the exit code of last command run in that particular step. Be sure to put any automated tests you want to ensure return the exit code you desire as the last command in a Probo Script Plugin step or in a separate Probo Build Step. False positives will occur if a command exits 1 after automated tests such as behat may actually be failing in the Probo Build Step. You can force a step to exit and fail on the first non-zero exit code using bash set -e inside of the Script. This same execution ordering should be noted on Probo plugins that extend the Probo Script Plugin like the Probo LAMP Plugin, the Probo Drupal Plugin, and the Probo Wordpress Plugin.

Using the Script plugin with 2 styles of strings:

Here is an example using a multi-line YAML string.

assets:
  - dev.sql.gz
steps:
  - name: List Pull Request files
    plugin: Script
    script: |
      gunzip -c $ASSET_DIR/dev.sql.gz | `mysql foo`
      rm $ASSET_DIR/dev.sql.gz
      cd $SRC_DIR
      files=$(ls)
      echo "Listing all files included in this Pull Request..."
      echo files $files

Here is an example using traditional YAML syntax.

assets:
  - dev.sql.gz
steps:
  - name: List Pull Request files
    plugin: Script
    script:
      - gunzip -c $ASSET_DIR/dev.sql.gz | `mysql foo`
      - rm $ASSET_DIR/dev.sql.gz
      - cd $SRC_DIR
      - files=$(ls)
      - echo "Listing all files included in this Pull Request..."
      - echo files $files
<< Probo Shell Plugin Probo LAMP Plugin >>