From 37678f914980c0a885d7fcde502289bcfcd93db9 Mon Sep 17 00:00:00 2001 From: Drew Short Date: Sat, 25 Dec 2021 14:48:10 -0600 Subject: [PATCH] Fixed a task processing bug --- acm.py | 9 +++++++-- pipeline.yml | 37 ++++++++++++++++++++----------------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/acm.py b/acm.py index d25a849..7275a73 100755 --- a/acm.py +++ b/acm.py @@ -28,7 +28,11 @@ VERSION = "1.4.0" async def run_command_shell( - command, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE, on_success: List[Callable] = [()]): + command, + stdout=asyncio.subprocess.PIPE, + stderr=asyncio.subprocess.PIPE, + on_success: List[Callable] = [()] +): """Run command in subprocess (shell). Note: @@ -43,7 +47,8 @@ async def run_command_shell( if process.returncode == 0: for callable in on_success: - callable() + if callable is not None: + callable() if stdout != asyncio.subprocess.DEVNULL: result = process_stdout.decode().strip() diff --git a/pipeline.yml b/pipeline.yml index 094a1ba..9aa8098 100644 --- a/pipeline.yml +++ b/pipeline.yml @@ -1,11 +1,10 @@ ---- resources: - name: git-resource type: git icon: git source: uri: https://git.nulloctet.com/warricksothr/Asset-Compression-Manager.git - tag_filter: "*[0-9].*[0-9].*[0-9]" + tag_filter: '*[0-9].*[0-9].*[0-9]' - name: git-resource-image-nexus type: docker-image icon: docker @@ -20,21 +19,25 @@ resources: repository: sothr/acm username: ((hub_docker_write.username)) password: ((hub_docker_write.password)) - jobs: - name: build-image plan: - - get: git-resource - trigger: true - - put: git-resource-image-nexus - params: - build: git-resource - tag_file: git-resource/.git/ref - tag_as_latest: true - get_params: {skip_download: true} - - put: git-resource-image - params: - build: git-resource - tag_file: git-resource/.git/ref - tag_as_latest: true - get_params: {skip_download: true} + - get: git-resource + trigger: true + - in_parallel: + - put: git-resource-image-nexus + params: + build: git-resource + cache: sothr/acm:latest + tag_file: git-resource/.git/ref + tag_as_latest: true + get_params: + skip_download: true + - put: git-resource-image + params: + build: git-resource + cache: sothr/acm:latest + tag_file: git-resource/.git/ref + tag_as_latest: true + get_params: + skip_download: true