K8s deploy
stages:
- ☸️
variables:
GITLAB_GROUP: "yodamad-trash"
GITLAB_PROJECT: "demo-kub"
GITLAB_AGENT: "demo-cluster"
default:
image:
name: bitnami/kubectl:latest
entrypoint: ['']
before_script:
- kubectl config use-context $GITLAB_GROUP/$GITLAB_PROJECT:$GITLAB_AGENT
🚀 :
stage: ☸️
script:
- kubectl create namespace ${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG} --dry-run=client -o yaml | kubectl apply -f -
- kubectl apply -f demo.yml -n ${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}
environment:
name: ${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}