Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
TravisCI Configuration Example for K8S and Skaffold
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
You can’t perform that action at this time.