Skip to content

Instantly share code, notes, and snippets.

@Gr1N
Created December 8, 2019 13:46
Show Gist options
  • Save Gr1N/a1df632ce2146dc06385dbc2eb1dd4d7 to your computer and use it in GitHub Desktop.
Save Gr1N/a1df632ce2146dc06385dbc2eb1dd4d7 to your computer and use it in GitHub Desktop.
Why Drone CI can be interesting for you? Example of Drone CI configuration using Jsonnet
local
volume_cached_poetry_path = 'cached-poetry',
volume_cached_poetry_deps = 'cached-deps',
command_install = 'poetry install -vv',
command_test = 'poetry run pytest .',
step(name, commands, version='3.8') = {
name: '%s-%s' % [name, version],
image: 'python:%s' % version,
commands: commands,
volumes: [
{
name: volume_cached_poetry_path,
path: '/root/.poetry',
},
{
name: volume_cached_poetry_deps,
path: '/root/.cache/pypoetry/virtualenvs',
},
],
};
{
kind: 'pipeline',
name: 'default',
steps: [
step('deps', [command_install], version='3.7'),
step('deps', [command_install]),
step('lint', [
'poetry run black --check --diff .',
'poetry run flake8 .',
'poetry run isort --check-only --diff --recursive',
]),
step('test', [command_test], version='3.7'),
step('test', [command_test]),
step('publish', ['poetry publish --build']),
],
volumes: [
{
name: volume_cached_poetry_path,
temp: {},
},
{
name: volume_cached_poetry_deps,
temp: {},
},
],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment