From 47638e04f951af63deb89b410a737f4a8749a420 Mon Sep 17 00:00:00 2001 From: Dmitry Groisman Date: Thu, 5 Sep 2019 14:12:53 +0300 Subject: [PATCH] helm repo ci --- .gitignore | 1 + .travis.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++ .yamllint.yml | 15 +++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 .yamllint.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..723ef36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..809293f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,45 @@ +language: python + +env: + global: + - HELM_URL=https://storage.googleapis.com/kubernetes-helm + - HELM_TGZ=helm-v2.14.3-linux-amd64.tar.gz + - TARGET_BR=gh-pages + - GH_URL=https://submariner-io.github.io/submariner-charts/ + - CHARTS_DIR=charts + - YAMLLINT_VERSION=1.17.0 + +install: + - wget -q ${HELM_URL}/${HELM_TGZ} + - tar xzfv ${HELM_TGZ} + - PATH=`pwd`/linux-amd64/:$PATH + - helm init --client-only + - sudo pip install yamllint=="${YAMLLINT_VERSION}" + +script: + - for dir in submariner submariner-k8s-broker; do helm lint $dir; done + - yamllint -c .yamllint.yml -s $(find . -type f -name "Chart.yaml") + - yamllint -c .yamllint.yml -s $(find . -type f -name "values.yaml") + +after_success: + - > + if [ $TRAVIS_BRANCH = 'master' ] && [ $TRAVIS_PULL_REQUEST = 'false' ]; then + for dir in submariner submariner-k8s-broker; do + helm dep update $dir + helm package $dir + done + REPO_URL=`git config remote.origin.url` + git clone ${REPO_URL} out && cd out && git checkout gh-pages && mkdir -p ${CHARTS_DIR} + cp -f ../submariner-*.tgz ${CHARTS_DIR}/ + if [ -f charts/index.yaml ]; then + helm repo index ${CHARTS_DIR} --url ${GH_URL} --merge index.yaml + else + helm repo index ${CHARTS_DIR} --url ${GH_URL} + fi + git config user.name "Travis CI" + git config user.email "travis@travis-ci.org" + git add -f ${CHARTS_DIR}/* + git commit -m "Travis build: $TRAVIS_BUILD_NUMBER" + git remote add origin-pages https://${GH_TOKEN}@github.com/submariner-io/submariner-charts.git > /dev/null 2>&1 + git push --quiet -f -u origin-pages gh-pages + fi diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..390a4bf --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,15 @@ +--- +extends: default +rules: + comments: disable + comments-indentation: disable + line-length: + max: 150 + braces: + min-spaces-inside: 0 + max-spaces-inside: 0 + brackets: + min-spaces-inside: 0 + max-spaces-inside: 0 + indentation: + indent-sequences: consistent \ No newline at end of file