Adding Rancher Keys

You will add these encrypted environment variables to the service you create below for executing your Rancher commands.

Defining Your Service

Because all the commands in your pipeline, via your codeship-steps.yml file, are executed inside the service you define and build build via your codeship-services.yml file - the first thing you will need to do is define a service that is capable of executing Rancher commands (and, specifically Rancher Compose commands.)

Note that this specific Rancher Compose command can be substituted for any command you need to run. The important thing is that the service directive is pointing to the service defined via your codeship-services.yml file with the Rancher Compose packages installed.

If you have multiple Rancher commands to run, you can combine them in a script file and execute that rather than running a command directly:

-name:rancher-deployservice:ranchercommand:deploy.sh

You will just need to add the required script to your repository and to the containers in your pipeline.