Skip to content

Instantly share code, notes, and snippets.

@behroozam
Created September 12, 2018 12:54
Show Gist options
  • Select an option

  • Save behroozam/3872a4c37f3316f78aa7c704e967e0e7 to your computer and use it in GitHub Desktop.

Select an option

Save behroozam/3872a4c37f3316f78aa7c704e967e0e7 to your computer and use it in GitHub Desktop.
gitlab ci docker build kubernetes deploy
stages:
- build
- kube
variables:
TEST_IMAGE: yourrepo/yourapp:${CI_BUILD_REF_NAME}_${CI_BUILD_REF}
RELEASE_IMAGE: yourrepo/yourapp:latest
build:
stage: build
script:
- docker build -t $TEST_IMAGE .
- docker push $TEST_IMAGE
tags:
- shell
kube test:
stage: kube
image: behroozam/kube:latest
script:
- ls kube/
- tag=${CI_BUILD_REF_NAME}_${CI_BUILD_REF} envsubst < kube/deplyment-example.yml > kube/deplyment-example-staging.yml
- kubectl apply -f kube/deplyment-example-staging.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment