From c11d05e48d2f10b6225f3775111cf07dacc6a247 Mon Sep 17 00:00:00 2001 From: Andrzej Pankowski Date: Tue, 28 Nov 2023 10:48:18 +0100 Subject: [PATCH] Use Long Sha in build Jobs (#9407) * long_sha * generate * generate2 * generate3 * review --- .../serverless/serverless-build-operator.yaml | 2 +- .../serverless/serverless-build-runtimes.yaml | 8 ++++++++ .../serverless/serverless-build.yaml | 8 ++++++++ templates/data/serverless.yaml | 17 +++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/prow/jobs/kyma-project/serverless/serverless-build-operator.yaml b/prow/jobs/kyma-project/serverless/serverless-build-operator.yaml index 03009571d7d6..28481e7977d3 100644 --- a/prow/jobs/kyma-project/serverless/serverless-build-operator.yaml +++ b/prow/jobs/kyma-project/serverless/serverless-build-operator.yaml @@ -76,7 +76,7 @@ presubmits: # runs on PRs - "sh" args: - "-c" - - "/image-builder --name=serverless-operator --config=/config/kaniko-build-config.yaml --context=. --dockerfile=components/operator/Dockerfile" + - "/image-builder --name=serverless-operator --config=/config/kaniko-build-config.yaml --context=. --dockerfile=components/operator/Dockerfile --tag=$PULL_BASE_SHA" env: - name: BUILDKITD_FLAGS value: "--oci-worker-no-process-sandbox" diff --git a/prow/jobs/kyma-project/serverless/serverless-build-runtimes.yaml b/prow/jobs/kyma-project/serverless/serverless-build-runtimes.yaml index e029ef468783..5c13bc725184 100644 --- a/prow/jobs/kyma-project/serverless/serverless-build-runtimes.yaml +++ b/prow/jobs/kyma-project/serverless/serverless-build-runtimes.yaml @@ -32,6 +32,7 @@ presubmits: # runs on PRs - "--config=/config/kaniko-build-config.yaml" - "--context=components/runtimes/nodejs" - "--dockerfile=nodejs16/Dockerfile" + - "--tag=$(PULL_BASE_SHA)" resources: requests: memory: 1.5Gi @@ -79,6 +80,7 @@ presubmits: # runs on PRs - "--config=/config/kaniko-build-config.yaml" - "--context=components/runtimes/nodejs" - "--dockerfile=nodejs18/Dockerfile" + - "--tag=$(PULL_BASE_SHA)" resources: requests: memory: 1.5Gi @@ -126,6 +128,7 @@ presubmits: # runs on PRs - "--config=/config/kaniko-build-config.yaml" - "--context=components/runtimes/python39" - "--dockerfile=components/runtimes/python39/Dockerfile" + - "--tag=$(PULL_BASE_SHA)" resources: requests: memory: 1.5Gi @@ -173,6 +176,7 @@ presubmits: # runs on PRs - "--config=/config/kaniko-build-config.yaml" - "--context=components/runtimes/java17" - "--dockerfile=Dockerfile-jvm-runtime" + - "--tag=$(PULL_BASE_SHA)" resources: requests: memory: 1.5Gi @@ -226,6 +230,7 @@ postsubmits: # runs on main - "--context=components/runtimes/nodejs" - "--dockerfile=nodejs16/Dockerfile" - "--tag=latest" + - "--tag=$(PULL_BASE_SHA)" resources: requests: memory: 1.5Gi @@ -276,6 +281,7 @@ postsubmits: # runs on main - "--context=components/runtimes/nodejs" - "--dockerfile=nodejs18/Dockerfile" - "--tag=latest" + - "--tag=$(PULL_BASE_SHA)" resources: requests: memory: 1.5Gi @@ -326,6 +332,7 @@ postsubmits: # runs on main - "--context=components/runtimes/python39" - "--dockerfile=components/runtimes/python39/Dockerfile" - "--tag=latest" + - "--tag=$(PULL_BASE_SHA)" resources: requests: memory: 1.5Gi @@ -376,6 +383,7 @@ postsubmits: # runs on main - "--context=components/runtimes/java17" - "--dockerfile=Dockerfile-jvm-runtime" - "--tag=latest" + - "--tag=$(PULL_BASE_SHA)" resources: requests: memory: 1.5Gi diff --git a/prow/jobs/kyma-project/serverless/serverless-build.yaml b/prow/jobs/kyma-project/serverless/serverless-build.yaml index 4f26dbc4eab3..8dff1bf830c5 100644 --- a/prow/jobs/kyma-project/serverless/serverless-build.yaml +++ b/prow/jobs/kyma-project/serverless/serverless-build.yaml @@ -32,6 +32,7 @@ presubmits: # runs on PRs - "--config=/config/kaniko-build-config.yaml" - "--context=components/serverless" - "--dockerfile=deploy/manager/Dockerfile" + - "--tag=$(PULL_BASE_SHA)" resources: requests: memory: 1.5Gi @@ -79,6 +80,7 @@ presubmits: # runs on PRs - "--config=/config/kaniko-build-config.yaml" - "--context=components/serverless" - "--dockerfile=deploy/webhook/Dockerfile" + - "--tag=$(PULL_BASE_SHA)" resources: requests: memory: 1.5Gi @@ -126,6 +128,7 @@ presubmits: # runs on PRs - "--config=/config/kaniko-build-config.yaml" - "--context=components/serverless" - "--dockerfile=deploy/jobinit/Dockerfile" + - "--tag=$(PULL_BASE_SHA)" resources: requests: memory: 1.5Gi @@ -174,6 +177,7 @@ presubmits: # runs on PRs - "--config=/config/kaniko-build-config.yaml" - "--context=components/serverless" - "--dockerfile=deploy/registry-gc/Dockerfile" + - "--tag=$(PULL_BASE_SHA)" resources: requests: memory: 1.5Gi @@ -226,6 +230,7 @@ postsubmits: # runs on main - "--config=/config/kaniko-build-config.yaml" - "--context=components/serverless" - "--dockerfile=deploy/manager/Dockerfile" + - "--tag=$(PULL_BASE_SHA)" - "--tag=latest" resources: requests: @@ -277,6 +282,7 @@ postsubmits: # runs on main - "--context=components/serverless" - "--dockerfile=deploy/webhook/Dockerfile" - "--tag=latest" + - "--tag=$(PULL_BASE_SHA)" resources: requests: memory: 1.5Gi @@ -327,6 +333,7 @@ postsubmits: # runs on main - "--context=components/serverless" - "--dockerfile=deploy/jobinit/Dockerfile" - "--tag=latest" + - "--tag=$(PULL_BASE_SHA)" resources: requests: memory: 1.5Gi @@ -378,6 +385,7 @@ postsubmits: # runs on main - "--context=components/serverless" - "--dockerfile=deploy/registry-gc/Dockerfile" - "--tag=latest" + - "--tag=$(PULL_BASE_SHA)" resources: requests: memory: 1.5Gi diff --git a/templates/data/serverless.yaml b/templates/data/serverless.yaml index 1d54d9814177..ab9effef0a0a 100644 --- a/templates/data/serverless.yaml +++ b/templates/data/serverless.yaml @@ -18,6 +18,7 @@ templates: - "--config=/config/kaniko-build-config.yaml" - "--context=components/serverless" - "--dockerfile=deploy/manager/Dockerfile" + - "--tag=$(PULL_BASE_SHA)" inheritedConfigs: global: - kaniko_buildpack @@ -36,6 +37,7 @@ templates: - "--config=/config/kaniko-build-config.yaml" - "--context=components/serverless" - "--dockerfile=deploy/manager/Dockerfile" + - "--tag=$(PULL_BASE_SHA)" - "--tag=latest" inheritedConfigs: global: @@ -54,6 +56,7 @@ templates: - "--config=/config/kaniko-build-config.yaml" - "--context=components/serverless" - "--dockerfile=deploy/webhook/Dockerfile" + - "--tag=$(PULL_BASE_SHA)" inheritedConfigs: global: - kaniko_buildpack @@ -73,6 +76,7 @@ templates: - "--context=components/serverless" - "--dockerfile=deploy/webhook/Dockerfile" - "--tag=latest" + - "--tag=$(PULL_BASE_SHA)" inheritedConfigs: global: - kaniko_buildpack @@ -90,6 +94,7 @@ templates: - "--config=/config/kaniko-build-config.yaml" - "--context=components/serverless" - "--dockerfile=deploy/jobinit/Dockerfile" + - "--tag=$(PULL_BASE_SHA)" inheritedConfigs: global: - kaniko_buildpack @@ -109,6 +114,7 @@ templates: - "--context=components/serverless" - "--dockerfile=deploy/jobinit/Dockerfile" - "--tag=latest" + - "--tag=$(PULL_BASE_SHA)" inheritedConfigs: global: - kaniko_buildpack @@ -127,6 +133,7 @@ templates: - "--config=/config/kaniko-build-config.yaml" - "--context=components/serverless" - "--dockerfile=deploy/registry-gc/Dockerfile" + - "--tag=$(PULL_BASE_SHA)" inheritedConfigs: global: - kaniko_buildpack @@ -147,6 +154,7 @@ templates: - "--context=components/serverless" - "--dockerfile=deploy/registry-gc/Dockerfile" - "--tag=latest" + - "--tag=$(PULL_BASE_SHA)" inheritedConfigs: global: - kaniko_buildpack @@ -171,6 +179,7 @@ templates: - "--config=/config/kaniko-build-config.yaml" - "--context=components/runtimes/nodejs" - "--dockerfile=nodejs16/Dockerfile" + - "--tag=$(PULL_BASE_SHA)" inheritedConfigs: global: - kaniko_buildpack @@ -189,6 +198,7 @@ templates: - "--context=components/runtimes/nodejs" - "--dockerfile=nodejs16/Dockerfile" - "--tag=latest" + - "--tag=$(PULL_BASE_SHA)" inheritedConfigs: global: - kaniko_buildpack @@ -205,6 +215,7 @@ templates: - "--config=/config/kaniko-build-config.yaml" - "--context=components/runtimes/nodejs" - "--dockerfile=nodejs18/Dockerfile" + - "--tag=$(PULL_BASE_SHA)" inheritedConfigs: global: - kaniko_buildpack @@ -223,6 +234,7 @@ templates: - "--context=components/runtimes/nodejs" - "--dockerfile=nodejs18/Dockerfile" - "--tag=latest" + - "--tag=$(PULL_BASE_SHA)" inheritedConfigs: global: - kaniko_buildpack @@ -239,6 +251,7 @@ templates: - "--config=/config/kaniko-build-config.yaml" - "--context=components/runtimes/python39" - "--dockerfile=components/runtimes/python39/Dockerfile" + - "--tag=$(PULL_BASE_SHA)" inheritedConfigs: global: - kaniko_buildpack @@ -257,6 +270,7 @@ templates: - "--context=components/runtimes/python39" - "--dockerfile=components/runtimes/python39/Dockerfile" - "--tag=latest" + - "--tag=$(PULL_BASE_SHA)" inheritedConfigs: global: - kaniko_buildpack @@ -273,6 +287,7 @@ templates: - "--config=/config/kaniko-build-config.yaml" - "--context=components/runtimes/java17" - "--dockerfile=Dockerfile-jvm-runtime" + - "--tag=$(PULL_BASE_SHA)" inheritedConfigs: global: - kaniko_buildpack @@ -291,6 +306,7 @@ templates: - "--context=components/runtimes/java17" - "--dockerfile=Dockerfile-jvm-runtime" - "--tag=latest" + - "--tag=$(PULL_BASE_SHA)" inheritedConfigs: global: - kaniko_buildpack @@ -372,6 +388,7 @@ templates: --config=/config/kaniko-build-config.yaml --context=. --dockerfile=components/operator/Dockerfile + --tag=$PULL_BASE_SHA inheritedConfigs: global: - jobConfig_presubmit