From 95759a7189dbd6291ff7f6e07f8ee4571fe492f6 Mon Sep 17 00:00:00 2001 From: Steve Wilkerson Date: Tue, 7 Feb 2017 14:03:55 -0600 Subject: [PATCH] Add travis-ci to openstack-helm Adds the travis.yml file to openstack-helm. The current travis workflow is: install glide for helm, build helm from source, run kubeadm in a container, init helm on the client side, then run tiller locally. The scripts currently run the makefile to check: helm dep up, helm lint, and helm package on the charts defined in the makefile. Then a helm install --dry-run debug is run on each of the charts packaged locally. --- .travis.yml | 33 +++++++++++++++++++++++++++++++++ travis-ci/charts_dry_run.sh | 6 ++++++ travis-ci/kubeadm_setup.sh | 5 +++++ 3 files changed, 44 insertions(+) create mode 100644 .travis.yml create mode 100644 travis-ci/charts_dry_run.sh create mode 100644 travis-ci/kubeadm_setup.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..62c1e39121 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,33 @@ +language: go + +services: + - docker + +before_install: + - export GLIDE_VERSION=v0.12.3 + - ls $GOPATH/src/ + - wget "https://github.com/Masterminds/glide/releases/download/$GLIDE_VERSION/glide-$GLIDE_VERSION-linux-amd64.tar.gz" + - mkdir -p $HOME/bin + - tar -vxz -C $HOME/bin --strip=1 -f glide-$GLIDE_VERSION-linux-amd64.tar.gz + - export PATH="$HOME/bin:$PATH" GLIDE_HOME="$HOME/.glide" + +install: + - cd $GOPATH/src/ + - mkdir k8s.io && cd k8s.io + - git clone https://github.com/kubernetes/helm + - cd helm && make bootstrap build + - mv bin/helm $HOME/bin + +script: + - cd $TRAVIS_BUILD_DIR + - bash travis-ci/kubeadm_setup.sh + - $HOME/gopath/src/k8s.io/helm/bin/tiller & + - export HELM_HOST=localhost:44134 + - helm init --client-only + - helm version + - helm serve & + - sleep 1m + - helm repo add local http://localhost:8879/charts + - helm repo update + - make + - bash travis-ci/charts_dry_run.sh diff --git a/travis-ci/charts_dry_run.sh b/travis-ci/charts_dry_run.sh new file mode 100644 index 0000000000..8fed0b1e29 --- /dev/null +++ b/travis-ci/charts_dry_run.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +for chart in *.tgz; do + echo "Running helm install --dry-run --debug on $chart"; + helm install --dry-run --debug local/$chart; +done diff --git a/travis-ci/kubeadm_setup.sh b/travis-ci/kubeadm_setup.sh new file mode 100644 index 0000000000..b2d933dd52 --- /dev/null +++ b/travis-ci/kubeadm_setup.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +docker run -it -e quay.io/attcomdev/kubeadm-ci:latest --name kubeadm-ci --privileged=true -d --net=host --security-opt seccomp:unconfined --cap-add=SYS_ADMIN -v /sys/fs/cgroup:/sys/fs/cgroup:ro -v /var/run/docker.sock:/var/run/docker.sock quay.io/attcomdev/kubeadm-ci:latest /sbin/init + +docker exec kubeadm-ci kubeadm.sh