Created
September 12, 2018 12:54
-
-
Save behroozam/3872a4c37f3316f78aa7c704e967e0e7 to your computer and use it in GitHub Desktop.
gitlab ci docker build kubernetes deploy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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