Steps are self-contained bash scripts or compiled binaries for accomplishing specific automation tasks, defined in the wercker.yml file of your application. Steps can be written manually or borrowed from the community via the Steps Registry.

An example of a step with parameters:

      - npm-install@1.0.5:
          package: jshint
          strict-ssl: false
      - npm-test

This will pass two parameters to the npm install step: package and strict-ssl.

Apart from predefined steps there are also custom steps , also known as inline steps. Custom steps allow you to run bash scripts directly within your Pipelines:

# A custom script step, name value is used in the UI
# and the code value contains the command that get executed
- script:
    name: echo python information
    code: |
      echo "python version $(python --version) running"
      echo "pip version $(pip --version) running"

This example echos back the Python and pip versions to us. Note that the result of these commands is available in the Wercker user interface and will be exposed as a build step under the name echo python information.

After steps

Wercker also has the notion of after-steps, which are ideally suited for notifications.

Internal steps

Certain steps are baked into the Wercker CLI. These are called Internal Steps. Read more about them here.

Changing the working directory

Some tools need to be in a certain directory to work; bundle-install for example will look for a Gemfile in the current directory and install the gems from that Gemfile. With Wercker it is possible to change the working directory for all steps. I is not necessary for the step developers to add extra code.

To change the working directory of a step you need to add a cwd element to the step. You can specify a relative path (relative from $WERCKER_ROOT) or an absolute path. Use of environment variables is possible.

    - bundle-install:
        cwd: src/

Creating your own steps

If you are unable to find a Step that you require on the Steps Registry, you can create your own. Deploying your step to the Steps Registry will allow others to use your Step.