Remove most of gitlabci job

This commit is contained in:
jpic 2020-02-15 19:38:57 +01:00
parent 93de46b061
commit 3c4f5f6d7e
4 changed files with 17 additions and 19 deletions

View File

@ -1,3 +1,7 @@
build:
image: yourlabs/shlax
script: pip install -U .[test] && py.test -svv tests
stage: test
pypi: pypi:
image: yourlabs/python image: yourlabs/python
only: only:

View File

@ -20,6 +20,10 @@ class Packages(Action):
Packages visitor will pick it up. Packages visitor will pick it up.
""" """
contextualize = ['mgr'] contextualize = ['mgr']
regexps = {
#r'Installing ([\w\d-]+)': '{cyan}\\1',
r'Installing': '{cyan}lol',
}
mgrs = dict( mgrs = dict(
apk=dict( apk=dict(

View File

@ -5,23 +5,8 @@ from shlax import *
class GitLabCIConfig(Script): class GitLabCIConfig(Script):
async def call(self, *args, write=True, **kwargs): async def call(self, *args, write=True, **kwargs):
self.context['definition'] = kwargs output = yaml.dump(self.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'])
self.output(output) self.output(output)
if write: if write:
with open('.gitlab-ci.yml', 'w+') as f: with open('.gitlab-ci.yml', 'w+') as f:
f.write(output) 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

View File

@ -4,18 +4,23 @@ from shlax.contrib.gitlab import *
PYTEST = 'py.test -svv tests' PYTEST = 'py.test -svv tests'
build = Buildah('alpine', build = Buildah('alpine',
Copy('shlax', 'setup.py', '/app'), Copy('shlax/', 'setup.py', '/app'),
Pip('/app'), Pip('/app'),
commit='yourlabs/shlax', commit='yourlabs/shlax',
) )
gitlabci = GitLabCIConfig( gitlabci = GitLabCIConfig(
Job('test', build=dict(
stage='test',
image='yourlabs/shlax',
script='pip install -U .[test] && ' + PYTEST,
),
test=dict(
stage='test', stage='test',
image='yourlabs/python', image='yourlabs/python',
script='pip install -U .[test] && ' + PYTEST, script='pip install -U .[test] && ' + PYTEST,
), ),
Job('pypi', pypi=dict(
stage='deploy', stage='deploy',
image='yourlabs/python', image='yourlabs/python',
script='pypi-release', script='pypi-release',