Skip to content

Instantly share code, notes, and snippets.

@juffaz
Created March 25, 2024 15:54
Show Gist options
  • Save juffaz/4789e5343ea2f36ec66391dcc10ba0e0 to your computer and use it in GitHub Desktop.
Save juffaz/4789e5343ea2f36ec66391dcc10ba0e0 to your computer and use it in GitHub Desktop.
gitlab-ci.yaml-k3s
stages:
- deploy-test
- deploy-prod
deploy-prod:
image:
name: bitnami/kubectl:1.27.3
entrypoint: [""]
stage: deploy-prod
only:
- main
script:
- kubectl apply -f $CI_PROJECT_DIR/kubernetes.yml # Directory where yamls are placed in repo
- kubectl get pods -n test
deploy-test:
image:
name: bitnami/kubectl:1.27.3
entrypoint: [""]
stage: deploy-test
environment:
name: test
url: https://test.site.az
only:
- test
script:
- kubectl apply -f $CI_PROJECT_DIR/kubernetes.yml # Directory where yamls are placed in repo
- kubectl get pods -n test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment