From d11ea653fa31d69ca6a2cd14be7fc2866b053d15 Mon Sep 17 00:00:00 2001 From: Levi <78334846+muhammad-levi@users.noreply.github.com> Date: Fri, 3 Jan 2025 10:02:07 +0700 Subject: [PATCH 1/3] Update entrypoint.sh to include optional param `-f` to `gke-deploy run` command Signed-off-by: Levi <78334846+muhammad-levi@users.noreply.github.com> --- entrypoint.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 49149a3..07b53d9 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -23,6 +23,7 @@ cluster_name="$4" project_id="$5" namespace="$6" expose_port="$7" +k8s_manifests="$8" gke_deploy_command="gke-deploy run -i $image -a $app_name -l $location -c $cluster_name -p $project_id" @@ -42,6 +43,11 @@ if [ -n "$expose_port" ]; then gke_deploy_command="$gke_deploy_command -x $expose_port" fi +# Add k8s manifests file(s) if the input is apparent. +if [ -n "$k8s_manifests" ]; then + gke_deploy_command="$gke_deploy_command -f $k8s_manifests" +fi + # Utilize Google APIs user agent for metrics with the following unique identifier: export GOOGLE_APIS_USER_AGENT=google-github-action:deploy-gke/$gha_version From 549034457f819d9ee7a0ee4d792be85baf0f38d5 Mon Sep 17 00:00:00 2001 From: Levi <78334846+muhammad-levi@users.noreply.github.com> Date: Fri, 3 Jan 2025 10:13:12 +0700 Subject: [PATCH 2/3] Update action.yml to add optional input `k8s_manifests` Signed-off-by: Levi <78334846+muhammad-levi@users.noreply.github.com> --- action.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/action.yml b/action.yml index e358878..f1aab9b 100644 --- a/action.yml +++ b/action.yml @@ -55,6 +55,13 @@ inputs: If not provided, it will not be passed to the binary. required: false + k8s_manifests: + description: |- + Local or GCS path to configuration file or directory of configuration files to use to create Kubernetes objects (file or files in directory must end in ".yml" or ".yaml"). + Prefix this value with "gs://" to indicate a GCS path. + If not provided, it will not be passed to the binary. + required: false + branding: icon: 'lock' color: 'blue' From 5f11d827bbcaad108ec11c014e40125d7cee98f1 Mon Sep 17 00:00:00 2001 From: Levi <78334846+muhammad-levi@users.noreply.github.com> Date: Fri, 3 Jan 2025 10:16:54 +0700 Subject: [PATCH 3/3] Update README.md to include optional input `k8s_manifests` Signed-off-by: Levi <78334846+muhammad-levi@users.noreply.github.com> --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 9cab529..be5eb40 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ jobs: project_id: 'my-project' namespace: 'my-namespace' expose: '8000' + k8s_manifests: 'configs' - name: 'get-deployments' shell: bash @@ -65,3 +66,9 @@ jobs: - `expose` - (Optional) The port provided will be used to expose the deployed workload object (i.e., port and targetPort will be set to the value provided in this flag). If not provided, it will not be passed to the binary. + +- `k8s_manifests` - (Optional) Local or GCS path to configuration file or + directory of configuration files to use to create Kubernetes objects + (file or files in directory must end in ".yml" or ".yaml"). + Prefix this value with "gs://" to indicate a GCS path. + If not provided, it will not be passed to the binary.