From 92b62799f478ba19e66b19f9b4fa5e880e2fbf4b Mon Sep 17 00:00:00 2001 From: jpic Date: Sun, 16 Feb 2020 18:59:39 +0100 Subject: [PATCH] Fix pre-commit hook --- .pre-commit-hooks.yaml | 2 +- shlax/targets/buildah.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index b021449..cbfc7b9 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -1,5 +1,5 @@ - id: shlaxfile-gitlabci name: Regenerate .gitlab-ci.yml description: Regenerate gitlabci - entry: pip install -e . && ./shlaxfile.py gitlabci + entry: ./shlaxfile.py gitlabci language: python diff --git a/shlax/targets/buildah.py b/shlax/targets/buildah.py index f5f3571..95a993a 100644 --- a/shlax/targets/buildah.py +++ b/shlax/targets/buildah.py @@ -159,8 +159,12 @@ class Buildah(Localhost): async def push(self): user = os.getenv('DOCKER_USER') passwd = os.getenv('DOCKER_PASS') - if user and passwd and os.getenv('CI') and self.image.registry: - await self.exec('buildah', 'login', '-u', user, '-p', passwd, self.image.registry) + if user and passwd and os.getenv('CI'): + self.output.cmd('buildah', 'login', '-u', '...', '-p', '...', self.image.registry) + old = self.output.debug + self.output.debug = False + await self.exec('buildah', 'login', '-u', user, '-p', passwd, self.image.registry or 'docker.io', ) + self.output.debug = old for tag in self.image.tags: await self.exec('buildah', 'push', f'{self.image.repository}:{tag}')