From a73d6a4ac9c5009ab3be023406128aeb2f901b78 Mon Sep 17 00:00:00 2001 From: Uday Chauhan Date: Tue, 27 Aug 2024 22:24:56 +0530 Subject: [PATCH 1/4] Adding katalon tool support for cloud builder --- katalon/Dockerfile | 6 ++++++ katalon/README.md | 23 +++++++++++++++++++++++ katalon/cloudbuild.yaml | 6 ++++++ 3 files changed, 35 insertions(+) create mode 100644 katalon/Dockerfile create mode 100644 katalon/README.md create mode 100644 katalon/cloudbuild.yaml diff --git a/katalon/Dockerfile b/katalon/Dockerfile new file mode 100644 index 000000000..30b8b2cac --- /dev/null +++ b/katalon/Dockerfile @@ -0,0 +1,6 @@ +FROM katalonstudio/katalon:9.6.0 + +RUN apt-get -y update && \ + apt-get -y install ca-certificates + +ENTRYPOINT ["sh"] diff --git a/katalon/README.md b/katalon/README.md new file mode 100644 index 000000000..20a9358aa --- /dev/null +++ b/katalon/README.md @@ -0,0 +1,23 @@ +# Katalon in Google Cloud Build + +This demonstrates using the +[`Katalon`](https://github.com/katalon-studio/docker-images) tool in Google Cloud +Build to produce Docker images in a registry, instead of using `docker build` +and `docker push`. + +## Steps: + +1. Modify the `cloudbuild.yaml` to define the steps to build your Docker image using Katalon. +2. Define the custom `Dockerfile` for Katalon, which installs necessary packages and defines an entry point. +3. Use the Cloud Build trigger to automate the process of building and pushing the Katalon image to your Container Registry, tagged with both `latest` and `9.6.0`. + +## Trigger the build locally + +To trigger the build locally using `gcloud`, navigate to your project root directory and run the following command: + +```bash +gcloud builds submit --config=cloudbuild.yaml . +``` + +This command will submit your build to Cloud Build using the cloudbuild.yaml configuration file, which includes the steps for tagging the image with both latest and 9.6.0. + diff --git a/katalon/cloudbuild.yaml b/katalon/cloudbuild.yaml new file mode 100644 index 000000000..b7d52cd8b --- /dev/null +++ b/katalon/cloudbuild.yaml @@ -0,0 +1,6 @@ +steps: +- name: gcr.io/katalon-project/executor:latest + args: ['--destination=gcr.io/$PROJECT_ID/built-with-katalon:latest', + '--destination=gcr.io/$PROJECT_ID/built-with-katalon:9.6.0', + '--cache=true'] +tags: ['cloud-builders-community'] From 0b7ab14af44a0fd52b77895c1bb8615b6ff772c8 Mon Sep 17 00:00:00 2001 From: Uday Chauhan Date: Tue, 27 Aug 2024 22:39:43 +0530 Subject: [PATCH 2/4] Trigger CLA check From 546dd4d4049d45f7f007e6deafa5c8b8990cacf7 Mon Sep 17 00:00:00 2001 From: Uday Chauhan Date: Tue, 27 Aug 2024 22:41:58 +0530 Subject: [PATCH 3/4] Trigger CLA check From 078e37e8fa03f7e6ddf123919dd945f9604b36ed Mon Sep 17 00:00:00 2001 From: Uday Chauhan Date: Wed, 28 Aug 2024 01:34:37 +0530 Subject: [PATCH 4/4] Adding Gcloud and Kubectl CLI along with katalon --- katalon/Dockerfile | 14 +++++++++++--- katalon/cloudbuild.yaml | 12 ++++++++---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/katalon/Dockerfile b/katalon/Dockerfile index 30b8b2cac..99ffcb8d0 100644 --- a/katalon/Dockerfile +++ b/katalon/Dockerfile @@ -1,6 +1,14 @@ FROM katalonstudio/katalon:9.6.0 -RUN apt-get -y update && \ - apt-get -y install ca-certificates +# Install apt dependencies and the Google Cloud SDK +RUN apt-get update && apt-get install -y apt-transport-https gnupg2 curl && \ + echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \ + curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \ + apt-get update && apt-get install -y google-cloud-sdk kubectl google-cloud-sdk-gke-gcloud-auth-plugin -ENTRYPOINT ["sh"] +# Verify that gcloud, kubectl, and gke-gcloud-auth-plugin are installed +RUN gcloud --version && kubectl version --client && gke-gcloud-auth-plugin --version +ENV PATH="$PATH:/usr/local/katalon" + +# Set default entrypoint to shell +ENTRYPOINT ["/bin/sh", "-c"] \ No newline at end of file diff --git a/katalon/cloudbuild.yaml b/katalon/cloudbuild.yaml index b7d52cd8b..e07a0859b 100644 --- a/katalon/cloudbuild.yaml +++ b/katalon/cloudbuild.yaml @@ -1,6 +1,10 @@ steps: -- name: gcr.io/katalon-project/executor:latest - args: ['--destination=gcr.io/$PROJECT_ID/built-with-katalon:latest', - '--destination=gcr.io/$PROJECT_ID/built-with-katalon:9.6.0', - '--cache=true'] +- name: 'gcr.io/kaniko-project/executor:latest' + args: + - --destination=gcr.io/$PROJECT_ID/built-with-katalon:latest + - --destination=gcr.io/$PROJECT_ID/built-with-katalon:9.6.0 + - --cache=true + env: + - DOCKERFILE=Dockerfile + - CONTEXT=dir://workspace tags: ['cloud-builders-community']