Commit 7f20b9a0 authored by Daniel Klaffenbach's avatar Daniel Klaffenbach 🐍

Enable CI

parent fdce02c1
Pipeline #8339 passed with stage
in 4 minutes and 9 seconds
stages:
- test
cache:
key: "$CI_PROJECT_NAME"
paths:
- $HOME/.cache/pip
before_script:
- python3.6 -m venv $HOME/tox
- $HOME/tox/bin/pip install tox
py27-django18-jsonfield0:
stage: test
script: $HOME/tox/bin/tox -e 'py27-django18-jsonfield0'
py27-django18-jsonfield1:
stage: test
script: $HOME/tox/bin/tox -e 'py27-django18-jsonfield1'
py27-django18-jsonfield2:
stage: test
script: $HOME/tox/bin/tox -e 'py27-django18-jsonfield2'
py27-django110-jsonfield0:
stage: test
script: $HOME/tox/bin/tox -e 'py27-django110-jsonfield0'
py27-django110-jsonfield1:
stage: test
script: $HOME/tox/bin/tox -e 'py27-django110-jsonfield1'
py27-django110-jsonfield2:
stage: test
script: $HOME/tox/bin/tox -e 'py27-django110-jsonfield2'
py27-django111-jsonfield0:
stage: test
script: $HOME/tox/bin/tox -e 'py27-django111-jsonfield0'
py27-django111-jsonfield1:
stage: test
script: $HOME/tox/bin/tox -e 'py27-django111-jsonfield1'
py27-django111-jsonfield2:
stage: test
script: $HOME/tox/bin/tox -e 'py27-django111-jsonfield2'
py36-django18-jsonfield0:
stage: test
script: $HOME/tox/bin/tox -e 'py36-django18-jsonfield0'
py36-django18-jsonfield1:
stage: test
script: $HOME/tox/bin/tox -e 'py36-django18-jsonfield1'
py36-django18-jsonfield2:
stage: test
script: $HOME/tox/bin/tox -e 'py36-django18-jsonfield2'
py36-django110-jsonfield0:
stage: test
script: $HOME/tox/bin/tox -e 'py36-django110-jsonfield0'
py36-django110-jsonfield1:
stage: test
script: $HOME/tox/bin/tox -e 'py36-django110-jsonfield1'
py36-django110-jsonfield2:
stage: test
script: $HOME/tox/bin/tox -e 'py36-django110-jsonfield2'
py36-django111-jsonfield0:
stage: test
script: $HOME/tox/bin/tox -e 'py36-django111-jsonfield0'
py36-django111-jsonfield1:
stage: test
script: $HOME/tox/bin/tox -e 'py36-django111-jsonfield1'
py36-django111-jsonfield2:
stage: test
script: $HOME/tox/bin/tox -e 'py36-django111-jsonfield2'
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import subprocess
"""
Generates a GitLab CI config from the tox.ini so that every
tox environment runs in a seprate GitLab CI job.
"""
YAML_TEMPLATE = """
stages:
- test
cache:
key: "$CI_PROJECT_NAME"
paths:
- $HOME/.cache/pip
before_script:
- python3.6 -m venv $HOME/tox
- $HOME/tox/bin/pip install tox
"""
def get_tox_envs():
p = subprocess.Popen(["tox", "-l"], stdout=subprocess.PIPE)
_stdout, _stderr = p.communicate()
return _stdout.decode("utf-8").splitlines()
def generate_gitlab_ci_yaml():
ci_config = YAML_TEMPLATE
for tox_env in get_tox_envs():
ci_config += "%s:\n" % tox_env
ci_config += " stage: test\n"
ci_config += " script: $HOME/tox/bin/tox -e '%s'\n\n" % tox_env
return ci_config
if __name__ == '__main__':
with open('.gitlab-ci.yml', 'w') as f:
f.write(generate_gitlab_ci_yaml())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment