You'll need roughly 4 minutes to read this article.
On Codeship, you are able to define deployment pipelines. A deployment pipeline is a set of deployment commands, or a deployment integration, configured to run whenever code is updated on a specific branch (such as
Every time you push a new commit or tag to this branch, or merge a pull request into this branch, a build will kick off that will run your deployment pipeline if all other setup and test command steps are successfully. Most projects will have at least one deployment pipeline, for deploying your code after successfully running your tests.
To set up your deployment pipelines, go to the Deployment page of your project settings to set up your deployment.
Add a branch that you would like to deploy and save it.
Choose your hosting provider or deployment method.
Fill out the deployment configuration and click the green checkmark on the top right of your deployment to save it.
On the next push to this branch (in this case ‘master’) the deployment will be triggered under the condition that all setup and test commands pass successfully.
As part of our deployment pipelines, Codeship provides turnkey deployment integrations for many common hosting providers, such as AWS Elastic Beanstalk, Heroku, Google App Engine and more.
To use a deployment integration, just click on the logo of your provider after creating your pipeline and add your authentication and configuration information as required.
While Codeship does provide many helpful deployment integrations, you may find that you want to run your own commands or your own custom scripts as part of a deployment pipeline.
You can use the Script Deployment to run your custom deployment commands or to execute other tasks right after or before a deployment. These will run as part of a deployment pipeline exactly as any of our deployment integrations would, but will rely on your scripts to provide exit status codes of
0 or any non-zero status code to indicate that they have either passed or failed.
You can add multiple deployments within one deployment pipeline. One easy example of this type of workflow would be to run your deployment commands and then, if they are successful, run post-deployment notification scripts. This process is easy to fully automated on Codeship. Note, though, that it is not possible to run multiple deployments in parallel. </div>
When you add a new branch to be deployed you can choose whether you are specifying an exact branch name or if this is a wildcard deployment.
For the latter select Branch starts with from the dropdown and then specify the common part of the branches you want to deploy.
Using a wildcard deployment, you can specify it to run a deployment on any branch that starts with a string. For instance:
features/dev-name-1/. In this scenario,
features/dev-name-1/test-casewould trigger a build, but
Another trick is setting Branch starts with to
%. This will match on all branches so you could trigger a deploy for all branches. You could then setup a custom deploy script to further customize the deployment actions for each branch.
It is likely that you will want multiple deployment pipelines, for instance one to deploy to a staging environment from your
staging branch and another to deploy to your production environment from your
To create separate deployment pipeline for another branch, click on “Add a branch to deploy” and enter the branch name.
After saving the deployment pipeline you can add your deployment methods for that branch.
By clicking on “Edit Branch Settings” you can change the branch name or delete that branch.
We also have a couple of code examples and sample projects available, that make it easier to get started with Codeship.