From baf4245776d8bdce57bc0874bc53915beb5cbc64 Mon Sep 17 00:00:00 2001 From: Shams mosowi Date: Thu, 2 Jul 2020 11:55:39 +0800 Subject: [PATCH] kaniko test, log current build config --- cloud_functions/functions/updateDeployStatus.ts | 9 ++++++--- cloudbuildfunctions.yaml | 6 ++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cloud_functions/functions/updateDeployStatus.ts b/cloud_functions/functions/updateDeployStatus.ts index 17740a8d..b5d4aadd 100644 --- a/cloud_functions/functions/updateDeployStatus.ts +++ b/cloud_functions/functions/updateDeployStatus.ts @@ -20,12 +20,15 @@ if (serviceAccount) { }); const db = admin.firestore(); - const main = async deployRequestPath => { - await db.doc(deployRequestPath).update({ deployedAt: serverTimestamp() }); + const main = async (deployRequestPath: string, currentBuild) => { + await db.doc(deployRequestPath).update({ + deployedAt: serverTimestamp(), + currentBuild: currentBuild ?? "", + }); return true; }; - main(process.argv[2]) + main(process.argv[2], process.argv[3]) .catch(err => console.log(err)) .then(() => console.log("this will succeed")) .catch(() => "obligatory catch"); diff --git a/cloudbuildfunctions.yaml b/cloudbuildfunctions.yaml index 81d99c76..c5854692 100644 --- a/cloudbuildfunctions.yaml +++ b/cloudbuildfunctions.yaml @@ -1,4 +1,9 @@ steps: + - name: "gcr.io/kaniko-project/executor:latest" + args: + - --destination=gcr.io/${_PROJECT_ID}/image + - --cache=true + - --cache-ttl=24h - name: gcr.io/cloud-builders/gcloud args: - kms @@ -34,6 +39,7 @@ steps: args: - "updateStatus" - "${_REQUEST_DOC_PATH}" + - "${_FUNCTION_CONFIG}" dir: "cloud_functions/functions" substitutions: