If you cannot find a step that solves a challenge you are facing in the Steps Store, you can create your own step and publish it. Steps are similar to any other projects on Wercker, but instead of deploying to a cloud provider, you deploy to the Steps Store in order to make the step available.
To be able to publish a step, you first need a Wercker application containing the following files:
wercker.ymlfile with a
run.shfile which is the entry-point of your step
- step manifest file called
Although a step can technically be written in any language, we recommended writing them in
bash or in
golang. The former is usually installed on most Docker containers, whereas the latter compiles to a single binary. Both programming languages do not require any dependencies or libraries to be present that might not be installed in various Docker containers people use, making them quite portable. If you do create a step in a different programming language, and require certain run time components, make sure to document this in the step
The Step Manifest file
The step manifest file defines the configuration of your step. Below an example of a Wercker step manifest which we’ll go over:
summary: Posts Wercker build/deploy status to a Slack channel.
- name: url
- name: channel
- name: username
- name: notify_on
- name: icon_url
- name: branch
summary field is the description for the step. We recommend using a small single line or single paragraph description. All other documentation should be in the
version , and
summary are required. All the following properties are optional, though we encourage people to use them.
tags fields contains an array of strings with keywords of this step. We recommend a few tags (at most 5) to describe the step.
keywords fields contains an array of strings with keywords of this step. We recommend a few tags (at most 5) to describe the step.
properties field contains metadata describing the parameters that are available for the step. This is a map; the key is the name of the step, and the value is a object with the following properties:
name- the name of the property
type- the type of the data of the parameter. Currently supported:
required- boolean indicating if the parameter is required or not (currently not enforced).
default- value that gets used, if no parameter was provided through the
The run.sh file
run.sh file contains the entrypoint your step logic. This should be
bash code in the
run.sh file itself. If you want to create a more complex application in a different language, than call this from within the
For each property you specified in your
step.yml, Wercker sets a corresponding environment variable. For example, the value of the
url property would be made available in the
$WERCKER_SLACK_NOTIFIER_URL environment variable. The name of the environment variable will be
WERCKER_ followed by the name of the step (from the
step.yml) converted to uppercase and with hyphens changed to underscores, followed by another underscore and then the name of the property converted to uppercase.
Notice that any hyphens you use in your parameter names will be transformed to underscores.
The Publish-Step Step
In order to publish a step to the Steps Store, the step's wercker.yml file needs to contain the
publish-step step, usually at the end. Below is an example of the
wercker.yml file for the aforementioned
name: prepare output
code: rm -rf $WERCKER_ROOT/.git
publish-step step has two optional parameters. The
auth_token contains the publishing user's personal token. The
owner can be used to specify the owner of the step (for example, an organization).
Having a separate pipeline
deploy) which contains the
publish-step step is not required.
Publishing your step
Publishing steps is done by
deploying your step to the Steps Store. To do so create a project on Wercker for your step by going to Create and selecting Application.
The build process will run in the same way as any other application on Wercker. After the application has built, and the
build pipeline has run, you can then publish the step by selecting
publish (or whichever pipeline you decided to contain the
publish-step) from the Actions drop-down of any completed (green) build.
To see the completed step go to app.wercker.com/steps.
To use your step in another application, refer to it using the owner and step name, for example:
# use the slack notifier step described above
owner should be replaced with the user or organization that owns this step. If you want to use a step owned by Wercker, you can omit the owner and just use the step name,
If you want to use a specific version of a step, as opposed to just using the latest available version, then you can append the version after the step name, like this:
# use the slack notifier step described above