From 3c4f5f6d7e7e3eaa708d1bfb89a878aa54f9f5ac Mon Sep 17 00:00:00 2001 From: jpic Date: Sat, 15 Feb 2020 19:38:57 +0100 Subject: [PATCH] Remove most of gitlabci job --- .gitlab-ci.yml | 4 ++++ shlax/actions/packages.py | 4 ++++ shlax/contrib/gitlab.py | 17 +---------------- shlaxfile.py | 11 ++++++++--- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b559397..cca2778 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,7 @@ +build: + image: yourlabs/shlax + script: pip install -U .[test] && py.test -svv tests + stage: test pypi: image: yourlabs/python only: diff --git a/shlax/actions/packages.py b/shlax/actions/packages.py index 81fb4f5..c509a5a 100644 --- a/shlax/actions/packages.py +++ b/shlax/actions/packages.py @@ -20,6 +20,10 @@ class Packages(Action): Packages visitor will pick it up. """ contextualize = ['mgr'] + regexps = { + #r'Installing ([\w\d-]+)': '{cyan}\\1', + r'Installing': '{cyan}lol', + } mgrs = dict( apk=dict( diff --git a/shlax/contrib/gitlab.py b/shlax/contrib/gitlab.py index 246b223..026acd9 100644 --- a/shlax/contrib/gitlab.py +++ b/shlax/contrib/gitlab.py @@ -5,23 +5,8 @@ from shlax import * class GitLabCIConfig(Script): async def call(self, *args, write=True, **kwargs): - self.context['definition'] = kwargs - await super().call(*args, **kwargs) - for name, definition in self.context['definition'].items(): - self.context['definition'][name] = definition - output = yaml.dump(self.context['definition']) + output = yaml.dump(self.kwargs) self.output(output) if write: with open('.gitlab-ci.yml', 'w+') as f: f.write(output) - - -class Job(Action): - async def call(self, *args, **kwargs): - self.context['definition'][self.args[0]] = self.kwargs - - def output_start(self): - pass - - def output_success(self): - pass diff --git a/shlaxfile.py b/shlaxfile.py index b6fbef5..4ae04e5 100755 --- a/shlaxfile.py +++ b/shlaxfile.py @@ -4,18 +4,23 @@ from shlax.contrib.gitlab import * PYTEST = 'py.test -svv tests' build = Buildah('alpine', - Copy('shlax', 'setup.py', '/app'), + Copy('shlax/', 'setup.py', '/app'), Pip('/app'), commit='yourlabs/shlax', ) gitlabci = GitLabCIConfig( - Job('test', + build=dict( + stage='test', + image='yourlabs/shlax', + script='pip install -U .[test] && ' + PYTEST, + ), + test=dict( stage='test', image='yourlabs/python', script='pip install -U .[test] && ' + PYTEST, ), - Job('pypi', + pypi=dict( stage='deploy', image='yourlabs/python', script='pypi-release',