CI for Laravel

The Build Pipeline

warning

The Build Pipeline settings, found at Project Settings > Build Pipeline, is used only when the file .chipperci.yml file is not found in the root of your repository. Find Yaml file docs here.

The content below pertains to builds configured in both YAML and the web UI.


Chipper CI sets each project up with a default pipeline that will work out of the box for many Laravel applications.

We chose the following default build steps, although you can change these however you'd like:

  1. Setup: Install PHP development dependencies, setup environment
  2. Assets: Install Node development dependencies and run the dev task (ensures a mix-manifest.json file exists)
  3. Test: Run your tests

You may edit these as much as you'd like!

We encourage you to group builds steps into logical steps to help make sense of the output and debug any issues.

Examples

Here are some examples you may want to use in your Build Pipeline!

Conditionals

Conditionally run some commands (such as triggering a build) based on a branch:

# Send a build trigger depending on the branch
if [[ $CI_COMMIT_BRANCH == 'master' ]]; then
    curl -X POST https://my-webhook-url/master/some-token \
        -d branch=$CI_COMMIT_BRANCH \
        -d commit=$CI_COMMIT_SHA
fi

if [[ $CI_COMMIT_BRANCH == 'develop' ]]; then
    curl -X POST https://my-webhook-url/develop/some-token \
        -d branch=$CI_COMMIT_BRANCH \
        -d commit=$CI_COMMIT_SHA
fi

You may also want to only do certain actions if Chipper is building a Git tag:

# If we're building a tag (if CI_COMMIT_TAG is not empty)
if [[ -n $CI_COMMIT_TAG ]]; then
    curl -X POST https://my-webhook-url/foo/bar \
        -d tag=$CI_COMMIT_TAG \
        -d commit=$CI_COMMIT_SHA
fi

Vapor

Deploy a Vapor build (as per the Vapor docs):

# This assumes environment variable VAPOR_API_TOKEN is set
vapor deploy production --commit="${CI_COMMIT_SHA}" --message="${CI_COMMIT_MESSAGE}"