Created
August 12, 2018 14:50
-
-
Save codygreen/a87ca430bda2dc271afa82b01de6f1d3 to your computer and use it in GitHub Desktop.
TravisCI Configuration Example for K8S and Skaffold
This file contains 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
sudo: enabled | |
services: | |
- docker | |
language: node_js | |
node_js: | |
- "8" | |
before_install: | |
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.7.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/ | |
- curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && chmod +x skaffold && sudo mv skaffold /usr/local/bin/ | |
install: | |
- npm install | |
script: | |
- npm run test:unit | |
after_success: | |
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin | |
- mkdir ${HOME}/.kube | |
- cp ./k8s/config.yaml ${HOME}/.kube/config | |
- cd ${HOME}/.kube | |
- sed -i 's/KUBE_CLUSTER_NAME/'"$KUBE_CLUSTER_NAME"'/g' config | |
- sed -i 's/KUBE_CLUSTER_CERTIFICATE/'"$KUBE_CLUSTER_CERTIFICATE"'/g' config | |
- sed -i 's/KUBE_CLIENT_CERTIFICATE/'"$KUBE_CLIENT_CERTIFICATE"'/g' config | |
- sed -i 's/KUBE_CLIENT_KEY/'"$KUBE_CLIENT_KEY"'/g' config | |
- sed -i 's/KUBE_ADMIN_PWD/'"$KUBE_ADMIN_PWD"'/g' config | |
- kubectl config use-context $KUBE_CLUSTER_NAME | |
- cd $TRAVIS_BUILD_DIR | |
- skaffold run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment