Getting started With CloudBees CodeShip Basic

4 minute read

Introducing CloudBees CodeShip Basic

CloudBees 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 CloudBees CodeShip Basic project. For a video introduction to CloudBees 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 CloudBees 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 CloudBees 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 CloudBees 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 CloudBees 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 CloudBees CodeShip Basic 2. Enter your custom deployment script in the box. Custom Script Deployment on CloudBees 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 CloudBees 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 CloudBees CodeShip Basic and CloudBees 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

CloudBees 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 get in touch with us to discuss configuration options. Parallel test pipelines on CloudBees 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 CloudBees CodeShip Basic.

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

CodeShip infrastructure

CloudBees CodeShip Basic builds run on fresh VMs provisioned on Ubuntu 20.04 (Focal Fossa). You can learn more about our infrastructure setup in the VM And Infrastructure documentation.