diff --git a/katalon/Dockerfile b/katalon/Dockerfile new file mode 100644 index 000000000..99ffcb8d0 --- /dev/null +++ b/katalon/Dockerfile @@ -0,0 +1,14 @@ +FROM katalonstudio/katalon:9.6.0 + +# 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 + +# 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/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..e07a0859b --- /dev/null +++ b/katalon/cloudbuild.yaml @@ -0,0 +1,10 @@ +steps: +- 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']