From 79a5f2d16441ba77c2983e0e0b537cad8e7a5862 Mon Sep 17 00:00:00 2001
From: Rasmus Soome <rasmus.soome@ut.ee>
Date: Tue, 21 Jan 2025 17:31:32 +0200
Subject: [PATCH] Ad descriptions for inputs

---
 .gitlab-ci.yml                           | 6 +++++-
 templates/ci-kustomize-cleanup.yml       | 7 +++++++
 templates/ci-kustomize-deploy-mr.yml     | 9 +++++++++
 templates/ci-kustomize-deploy.yml        | 9 +++++++++
 templates/ci-kustomize-secret-create.yml | 8 ++++++--
 5 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0a3c154..8d44e32 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,4 +1,8 @@
-# Test components
+##
+## This file is used to test the components with different inputs
+## and to create a release of the component if a tag is pushed.
+##
+
 include:
 
   - component: $CI_SERVER_HOST/$CI_PROJECT_PATH/ci-kustomize-secret-create@$CI_COMMIT_SHA
diff --git a/templates/ci-kustomize-cleanup.yml b/templates/ci-kustomize-cleanup.yml
index 0777b29..2eb72e3 100644
--- a/templates/ci-kustomize-cleanup.yml
+++ b/templates/ci-kustomize-cleanup.yml
@@ -2,18 +2,25 @@ spec:
   inputs:
     name:
       default: "kustomize:cleanup"
+      description: "Name of the job"
     stage:
       default: .post
+      description: "Stage name of the job"
     environment_name:
+      description: "Name of the CI job environment"
     kustomize_image:
       default: $CI_REGISTRY_IMAGE/$CI_COMMIT_BRANCH:$CI_COMMIT_SHA
+      description: "The image name to set for the deployment with kustomize"
 
     deploy_path:
       default: deploy/
+      description: "The path in which the deploy files are located"
     overlay_path:
       default: $CI_COMMIT_BRANCH
+      description: "The relative path in relation to `deploy_path` of the overlay files."
     kubeconfig:
       default: $KUBECONFIG
+      description: "Kubeconfig file location"
 
 
 ---
diff --git a/templates/ci-kustomize-deploy-mr.yml b/templates/ci-kustomize-deploy-mr.yml
index 448700e..51173bf 100644
--- a/templates/ci-kustomize-deploy-mr.yml
+++ b/templates/ci-kustomize-deploy-mr.yml
@@ -2,26 +2,35 @@ spec:
   inputs:
     name:
       default: "kustomize:deploy:mr"
+      description: "Name of the job"
     stage:
       default: deploy
+      description: "Stage name of the job"
     environment_name:
       default: $CI_MERGE_REQUEST_IID
+      description: "Name of the CI job environment"
     auto_stop_in:
       default: 5 minutes
+      description: "Time to auto stop the environment in"
     allow_failure:
       type: boolean
       default: false
 
     deploy_path:
       default: deploy/
+      description: "The path in which the deploy files are located"
     overlay_path:
       default: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
+      description: "The relative path in relation to `deploy_path` of the overlay files."
     kustomize_image:
       default: $CI_REGISTRY_IMAGE/$CI_MERGE_REQUEST_IID:$CI_COMMIT_SHA
+      description: "The image name to set for the deployment with kustomize"
     kubeconfig:
       default: $KUBECONFIG
+      description: "Kubeconfig file location"
     deploy_on_mr:
       default: "false"
+      description: "Set to 'true' to run this job on merge requests."
 
 ---
 
diff --git a/templates/ci-kustomize-deploy.yml b/templates/ci-kustomize-deploy.yml
index 317ceab..268b2b7 100644
--- a/templates/ci-kustomize-deploy.yml
+++ b/templates/ci-kustomize-deploy.yml
@@ -2,8 +2,10 @@ spec:
   inputs:
     name:
       default: "kustomize:deploy:branch"
+      description: "Name of the job"
     stage:
       default: deploy
+      description: "Stage name of the job"
     rules:
       type: array
       default:
@@ -11,22 +13,29 @@ spec:
           when: never
         - if: $CI_PIPELINE_SOURCE == "web"
         - if: $CI_PIPELINE_SOURCE == "push"
+      description: "Rules when to run the job."
     environment_name:
       default: $CI_COMMIT_BRANCH
+      description: "Name of the CI job environment"
     auto_stop_in:
       default: never
+      description: "Time to auto stop the environment in"
     allow_failure:
       type: boolean
       default: false
 
     deploy_path:
       default: deploy/
+      description: "The path in which the deploy files are located"
     overlay_path:
       default: $CI_COMMIT_BRANCH
+      description: "The relative path in relation to `deploy_path` of the overlay files."
     kustomize_image:
       default: $CI_REGISTRY_IMAGE/$CI_COMMIT_BRANCH:$CI_COMMIT_SHA
+      description: "The image name to set for the deployment with kustomize"
     kubeconfig:
       default: $KUBECONFIG
+      description: "Kubeconfig file location"
 
 ---
 
diff --git a/templates/ci-kustomize-secret-create.yml b/templates/ci-kustomize-secret-create.yml
index 3c84d00..e4183ea 100644
--- a/templates/ci-kustomize-secret-create.yml
+++ b/templates/ci-kustomize-secret-create.yml
@@ -2,15 +2,19 @@ spec:
   inputs:
     name:
       default: "kustomize:secret-create"
+      description: "Name of the job"
+    stage:
+      default: .pre
+      description: "Stage name of the job"
     secret_name:
       default: regcred-$CI_PROJECT_NAME
+      description: "The name of the secret to create in Kubernetes"
     allow_failure:
       type: boolean
       default: false
     kubeconfig:
       default: $KUBECONFIG
-    stage:
-      default: .pre
+      description: "Kubeconfig file location"
 
 ---
 
-- 
GitLab