Skip to main content

YAML configuration file support for Codeship.

Project description

Build status Code health Python versions Monthly downloads from PyPI Software license Gitter chat room

YAML configuration file support for Codeship.

Syntax Compatibility

Travis CI

Build status

Shippable

Build status

VexorCI

Build status

Background

Many continuous integration services support YAML configuration files in order to support the infrastructure as code paradigm. Codeship, though one of the most appealing platforms, is missing this feature. You have to add commands regarding setup, testing and deployment in your Codeship project settings. This has various disadvantages, but even though users are complaining Codeship is not planning to address the issue on its traditional build server infrastructure. (Only Codeship’s new Docker-based infrastructure will finally make you more happy.)

Usage

Create a codeship.yml file in your repository at root level. The syntax is inspired by Travis CI and Shippable, though only limited features are supported. Example:

install:
  - pip install flake8
before_script:
  - touch codeship-yaml-was-here
script:
  - flake8
after_success:
  - echo "Now we can deploy"

To make Codeship read and interpret your codeship.yml file, and execute the commands in it add the following lines in the Setup Commands text box at Codeship > Select Project… > (your project), Project Settings > Test Settings.

pip install codeship-yaml
codeship-yaml

This will make codeship-yaml execute the commands you specified in the default sections in the following section order:

  1. install

  2. before_script

  3. script

  4. after_success

More Control

If you want more control over which sections are executed you can specify the requested section as a parameter. For example, you could add the following commands into the below-mentioned text boxes of your Codeship project:

Project Settings > Test Settings > Setup Commands

pip install codeship-yaml
codeship-yaml install

Project Settings > Test Settings > Test Commands

codeship-yaml before_script script

Project Settings > Deployment > (branch name)

codeship-yaml after_success

Adding custom sections, other than the default ones, to your codeship.yml file is possible but discouraged (to avoid losing similarity with other build platforms). If you want an additional section, which is established on other platforms already, please consider placing a pull request.

Python 3

The build image of Codeship’s classic infrastructure supports both Python 2.7 and 3.4, but for Python 3 some outdated packages will make you run into broken builds (e.g. when you install packages with environment markers in setup.py).

To have fully working Python 3.4 support use the following setup commands in Project Settings > Test Settings > Setup Commands:

virtualenv -p $(which python3) "${HOME}/cache/python3_env"
. "${HOME}/cache/python3_env/bin/activate" && python --version
pip install --upgrade setuptools && pip list | grep setuptools
Update:

More Python versions are now supported via a python.sh script provided by Codeship. See the top of the script for usage instructions.

Contribute

For development we use tox, which handles both static code analysis and tests for all supported Python versions. tox is automatically installed for the test runs and will work out-of-the-box when you run the tests through setup.py. Unfortunately, you’ll have to install virtualenv though:

$ pip install virtualenv

After making your code changes don’t forget to add tests, and simply run:

$ python setup.py test

When you place a pull request all tests are run on the build server infrastructure of Codeship, Travis CI, Shippable and Vexor again. Please check if they all pass to ensure the syntax stays compatible across the different build infrastructures.

To remove all build files and folders including Python byte code you can run:

$ python setup.py clean

Credits

This project is brought to you by Painless Software, a best-practice consultancy in software development. Less pain, more fun.

A big, massive “Thank you!” to all contributors:

  • Dave Allie (sectioning and coloring of command output)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codeship-yaml-0.2.tar.gz (18.9 kB view details)

Uploaded Source

File details

Details for the file codeship-yaml-0.2.tar.gz.

File metadata

  • Download URL: codeship-yaml-0.2.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for codeship-yaml-0.2.tar.gz
Algorithm Hash digest
SHA256 0db5434a028c46897e1283c8c7dc4678ec18ae15690d0ea1e30d505f5c8a6ea8
MD5 180125e8f5ff87bf6e5b7c544b315c5f
BLAKE2b-256 17932a69d9112654882dec18fd615eecdb9659685b0a93931940d7941137caf9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page