Skip to content

Instantly share code, notes, and snippets.

@ju5t
Last active August 31, 2019 10:57
Show Gist options
  • Save ju5t/e8a8bf5dd241ba824fbcfcde5dc6dc82 to your computer and use it in GitHub Desktop.
Save ju5t/e8a8bf5dd241ba824fbcfcde5dc6dc82 to your computer and use it in GitHub Desktop.
variables:
K8S_NAMESPACE: $CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG
stages:
- deploy
deploy-k8s:
image: dtzar/helm-kubectl
stage: deploy
before_script:
- apk add -u gettext
- kubectl create secret docker-registry regcred --docker-server=$CI_REGISTRY --docker-username="$CI_DEPLOY_USER" --docker-password="$CI_DEPLOY_PASSWORD" --docker-email="$GITLAB_USER_EMAIL" --dry-run=true -o yaml | kubectl apply -f -
environment:
name: test
url: test.yourapp.com
script:
- VERSION="${CI_COMMIT_TAG:-none}" envsubst < k8s.yml | kubectl apply -f -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment