From 86d40810d3728282ddbac6a560a03190bbca47eb Mon Sep 17 00:00:00 2001 From: Kartik Shah Date: Tue, 7 May 2024 02:27:05 +0530 Subject: [PATCH] ci: reenable kaniko builder --- ci/apps/app-template.lib.yml | 19 ++++++++++++------- ci/core/template.lib.yml | 19 ++++++++++++------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/ci/apps/app-template.lib.yml b/ci/apps/app-template.lib.yml index 911ce01222..a308de7d48 100644 --- a/ci/apps/app-template.lib.yml +++ b/ci/apps/app-template.lib.yml @@ -107,24 +107,29 @@ plan: run: path: pipeline-tasks/ci/apps/tasks/prepare-docker-build.sh - task: build + #@ def build_args(app): + #@ dockerfile_path = "repo/apps/" + app + "/Dockerfile" + #@ build_args_command = "$(awk -F= '{print \"--build-arg=\"$1\"=\"$2}' repo/.build-args)" + #@ kaniko_args="/kaniko/executor --context=repo --use-new-run --single-snapshot --cache=false --no-push --tar-path=image/image.tar --dockerfile=" + dockerfile_path + " " + build_args_command + #@ args = ["-exc"] + #@ args.append(kaniko_args) + #@ return args + #@ end attempts: 2 - privileged: true config: platform: linux image_resource: type: registry-image source: - repository: vito/oci-build-task + repository: gcr.io/kaniko-project/executor + tag: debug inputs: - name: repo outputs: - name: image - params: - CONTEXT: repo - DOCKERFILE: #@ "repo/apps/" + app + "/Dockerfile" - BUILD_ARGS_FILE: repo/.build-args run: - path: build + path: /bin/sh + args: #@ build_args(app) - put: #@ edge_image_resource_name(app) params: image: image/image.tar diff --git a/ci/core/template.lib.yml b/ci/core/template.lib.yml index f1d486fbc9..0ccc1a5310 100644 --- a/ci/core/template.lib.yml +++ b/ci/core/template.lib.yml @@ -205,24 +205,29 @@ plan: run: path: pipeline-tasks/ci/core/tasks/prepare-docker-build.sh - task: build + #@ def build_args(component): + #@ dockerfile_path = "repo/core/" + component + "/Dockerfile" + post_fix + #@ build_args_command = "$(awk -F= '{print \"--build-arg=\"$1\"=\"$2}' repo/.build-args)" + #@ kaniko_args="/kaniko/executor --context=repo --use-new-run --single-snapshot --cache=false --no-push --tar-path=image/image.tar --dockerfile=" + dockerfile_path + " " + build_args_command + #@ args = ["-exc"] + #@ args.append(kaniko_args) + #@ return args + #@ end attempts: 2 - privileged: true config: platform: linux image_resource: type: registry-image source: - repository: vito/oci-build-task + repository: gcr.io/kaniko-project/executor + tag: debug inputs: - name: repo outputs: - name: image - params: - CONTEXT: repo - DOCKERFILE: #@ "repo/core/" + component + "/Dockerfile" + post_fix - BUILD_ARGS_FILE: repo/.build-args run: - path: build + path: /bin/sh + args: #@ build_args(component) - put: #@ edge_image_resource_name(component + post_fix) params: image: image/image.tar