YAML configuration file support for Codeship.
Project description
YAML configuration file support for Codeship.
Syntax Compatibility |
|
---|---|
Travis CI |
|
Shippable |
|
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:
install
before_script
script
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 Basic runs Python 2.7 by default, but versions 3.4 through 3.7 are also installed. Codeship requires you to activate them using pyenv. Python is not Codeship’s main expertise though, so expect a bumpy ride. Activating Python versions could be made easier. Sad story.
To make all Python versions available in parallel add the following command to the top of your Project Settings > Setup Commands on Codeship:
pyenv global 2.7 3.4 3.5 3.6 3.7
Contribute
For development we use tox, which handles both static code analysis and tests for all supported Python versions.
$ pip install tox
After making your code changes don’t forget to add tests, and simply run:
$ tox
When you place a pull request all tests are run on the build server infrastructure of Codeship, Travis CI and Shippable 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:
$ tox -e 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
Built Distributions
File details
Details for the file codeship-yaml-0.4.0.tar.gz
.
File metadata
- Download URL: codeship-yaml-0.4.0.tar.gz
- Upload date:
- Size: 20.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb9595f360d91f444a651e3d50e302e9cbe6e1d2d1be10b52cab8cee08967146 |
|
MD5 | a0efd806d6969dd88b95769f095f4678 |
|
BLAKE2b-256 | be44f1a58d2466bb717c516e6b2f1e86ce5b67ea8c28221e106c297cb49071d3 |
File details
Details for the file codeship_yaml-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: codeship_yaml-0.4.0-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ba8d9c449e93d173180870a4bfebba200b6238cdaba7ff6c737b13a746b2b49 |
|
MD5 | c1b5b4ee8cf95e7523e3edf7add37a26 |
|
BLAKE2b-256 | 75ef9233bf6fea32e0798e8697314e666176d8a9a210c2be547976d784d40b17 |
File details
Details for the file codeship_yaml-0.4.0-py2-none-any.whl
.
File metadata
- Download URL: codeship_yaml-0.4.0-py2-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e2eb8cf1078edc654f77d0b454fbe58c8a4aff380e3d58e1fa7367cabf198a6 |
|
MD5 | bb1dcf547a4b4cea6aa8ea1c521a0bcc |
|
BLAKE2b-256 | fb2fd197ab40c0b66a76d8f1f9eec1fa99818405a046b15d16feabb9562d67f2 |