Commit 6c183b71 authored by moha-s's avatar moha-s
Browse files

update doc and job metadata

parent 9260d0c7
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -19,7 +19,8 @@ This job will deploy your cluster using Kustomize and set a new image for the de
* Docker image:
[`nekottyo/kustomize-kubeval:latest`](https://hub.docker.com/r/nekottyo/kustomize-kubeval)
* Default stage: `deploy`
* When: `always`
* When: `manual`, only when running on default branch (`$CI_DEFAULT_BRANCH`).  
  To update this behavior, see [job customization](https://r2devops.io/use-the-hub/#global) to override [`rules`](https://docs.gitlab.com/ee/ci/yaml/#rulesif)

### Variables

@@ -31,11 +32,11 @@ This job will deploy your cluster using Kustomize and set a new image for the de
| `PROJECT_ROOT` | path to the root of the project | no | `.`
| `KUBECONFIG` | the config file for kubectl | yes | ` `
| `KUSTOMIZATION_DIR` | the folder that contains the `kustomization.yaml` file | yes | ` `
| `NAMESPACE` | The namespace to use for deployment | yes | ` `
| `NAMESPACE` | The namespace to use for deployment | yes | `$KUBE_NAMESPACE`
| `DEPLOYMENT_NAME` | name of deployment to use | yes | ` `
| `CONTAINER_NAME` | name of the containers to update | yes | ` `
| `IMAGE_NAME` | name of the new image to use | yes | ` `
| `IMAGE_TAG` | the tag to use for the new image | yes | `latest`
| `IMAGE_TAG` | the tag to use for the new image | yes | ` `
| `KUSTOMIZE_OPTIONS` | Additional options for `kubectl` command | no | ` `

### Artifacts
+13 −3
Original line number Diff line number Diff line
@@ -10,17 +10,24 @@ kustomize_deploy:
    PROJECT_ROOT: "."
    KUBECONFIG: ""
    KUSTOMIZATION_DIR: ""
    NAMESPACE: ""
    NAMESPACE: "$KUBE_NAMESPACE"
    DEPLOYMENT_NAME: ""
    CONTAINER_NAME: ""
    IMAGE_NAME: ""
    IMAGE_TAG: "latest"
    IMAGE_NAME: "$CI_REGISTRY_IMAGE"
    IMAGE_TAG: ""
    KUSTOMIZE_OPTIONS: ""


  script:
    # Working directory
    - cd $PROJECT_ROOT
    - if [ -z ${IMAGE_TAG} ]; then
    -   if [ ! -z ${CI_COMMIT_TAG} ]; then
    -     IMAGE_TAG=${CI_COMMIT_TAG}
    -   else
    -     IMAGE_TAG=${CI_COMMIT_SHA}
    -   fi
    - fi
    # Deploy the cluster
    - kubectl apply -k $KUSTOMIZATION_DIR $KUSTOMIZE_OPTIONS >> output.log
    # Set the current namespace
@@ -33,3 +40,6 @@ kustomize_deploy:
    expose_as: "Kustomize job output"
    paths:
      - output.log

  rules:
    - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
 No newline at end of file