This article is about Codeship Basic.

Getting Started With Codeship Basic

You will need roughly 7 minutes to read this article.

Introducing Codeship Basic

Codeship Basic makes it easy and simple to get a working CI/CD process running through an easy-to-configure web UI and turnkey deployments.

This article will walk you through setting up a Codeship Basic project. For a video introduction to Codeship Basic, you can view our overview video.

Setting up continuous integration with Codeship

Prerequisites

Codeship requires that you set up a Codeship Account and connect to a Source Content Management (SCM). See Setting Up A New Codeship Account Guide for more information.

Configuring your setup commands

Setup commands are the commands needed to run your tests and deployments. Examples of setup commands include fetching dependencies and seeding the database.

To configure your setup commands:

  1. Select the Tests tab in the dashboard.

  2. Click the dropdown arrow on the right to see a list of technologies.

  3. Either select a technology to pre-populate basic commands or select I want to create my own custom commands.

  4. If select I want to create my own custom commands then enter setup commands in box.

  5. Either click Save and go to dashboard or Save Changes.

Setup Commands on Codeship Basic

Note that Codeship provides a list of popular setup commands for many common languages in the dropdown, but you can enter in your own commands as needed.

Configuring your test commands

Next, you will enter in your test commands. These are all tests you want to have run in your CI/CD pipeline, and all deployments you configure will be contingent on these tests passing.

Setup Commands on Codeship Basic

Defining your deployment pipeline with Codeship

Now that you’ve defined your setup and test commands, you’ll want to define your deployment pipelines. Deployment pipelines run only when a build’s setup and tests commands have completed successful and only when the branch defined for the deployment is matched. We call them deployment pipelines rather than deployments because you can have different deployment destinations - perhaps staging and master environments - triggered by different branches.

To configure your deployment pipelines:

  1. Select the Deploy tab in the dashboard.

  2. Click the dropdown arrow on the right to see a list of ways to configure a branch that triggers the deployment pipeline.

  3. Select either Branch is exactly to match a specific branch or select Branch starts with to match any branch that starts with a specific string.

  4. Enter branch name in the box.

  5. Click the Save Pipeline Settings button.

See deployment pipeline for more information.

Add New Deployment Pipeline on Codeship Basic

Using pre-configured deployments to deploy to cloud services

After specifying which branch triggers your new deployment pipeline, you can choose to use one of Codeship’s pre-configured deployment integrations or to use your own custom script deployment.

To use a pre-configured deployment:

Click on your host provider and then provide the necessary account credentials as requested.

Add New Deployment Pipeline on Codeship Basic

Using your own custom deployment scripts to deploy to cloud services

If you don’t want to use one of the pre-configured deployment integrations, you can instead use your own custom script deployment.

To use your own custom script deployment:

  1. Select the Custom Script button. Custom Script Deployment on Codeship Basic
  2. Enter your custom deployment script in the box. Custom Script Deployment on Codeship Basic
  3. Click the Create Deployment button.

Adding multiple deployment steps

It’s worth noting that for each deployment pipeline, you can add multiple deployments or multiple deployment steps. For instance, you can have one deployment on a master pipeline that runs your deployment scripts followed by another pipeline that runs notification scripts.

To add multiple steps or deployments to a pipeline:

Click on an additional deployment target and specify as needed. You can then use the simple drag-and-drop interface to arrange the deployment commands in the order you need them to run in.

Custom Script Deployment on Codeship Basic

Running a build

You can trigger a build when committing, merging, and pushing tags to your project. This is default behavior. You can also trigger a build when opening, merging, and updating a Pull Request (PR). See Configuring Build Triggers for more information.

Skipping a build

You can skip builds on both CodeShip Basic and CodeShip Pro by using a special commit directive. See Skipping Builds for more information.

Speeding up a build

Using the cache to speed up a build

Codeship Basic has an automatic, built-in dependency cache, meaning we cache the packages directory for the most common dependency management systems, like NPM and Rubygems. You can clear your dependency cache at any time.

To clear your dependency cache:

  1. Select Builds from the top-level navigation.

  2. Click the drop down arrow from the Build box.

  3. Select Reset Cache.

Reset Dependency Cache

Creating parallel test pipelines to speed up a build

Codeship offers the option to upgrade your Basic account with additional parallel test pipelines, allowing you to run multiple test commands simultaneously as a way to speed up your builds.

You can sign up for a free Parallel Test Pipelines Trial by clicking Add Pipeline or get in touch with us to discuss configuration options. Parallel test pipelines on Codeship Basic

Troubleshooting

Clearing the cache

You can clear the cache to help clear failing builds.

Opening a SSH debug session

In order to troubleshoot issues, Codeship provides command line access to a replicated instance of your build. The SSH debug session will include all configured variables from the original build run. See Debugging builds via SSH for more information.

System timeouts

If a command runs for longer than 10 minutes without printing any log output, the command and build will be automatically failed. Additionally, if a build runs for longer than 3 hours, it will be automatically failed.

Additional information

Accessing Codeship using the API

If you’re looking to automate more of your processes, you can access your projects and builds via the Codeship API. See the Codeship API Documentation for more details and examples.

Scripts library

We maintain a scripts library with scripts for common packages, deployments and other useful workflow improvements on Codeship Basic.

If you’re looking for a specific tool or version, the scripts library is a great first place to check.

Codeship infrastructure

Codeship Basic builds run on fresh VMs provisioned on Ubuntu 18.04 (Bionic). You can learn more about our infrastructure setup here.

Need more help?

Contact our support team or post on Stack Overflow using the tag #codeship. Did you check the status page and changelog?

There are also several code examples and sample projects available for you to get started with.

Article not helpful?

Does this article need improvement? If so, please send feedback or submit a pull request!