From 8bdd009bbe89df963292fdbe1c5f0ba2347f2539 Mon Sep 17 00:00:00 2001 From: Vic Iglesias Date: Tue, 30 Aug 2016 21:48:26 -0700 Subject: [PATCH 1/3] Add linting for charts --- test/Dockerfile | 25 +++++++++++++++++++++++++ test/changed.sh | 9 +++++++++ test/e2e.sh | 3 ++- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 test/Dockerfile create mode 100755 test/changed.sh diff --git a/test/Dockerfile b/test/Dockerfile new file mode 100644 index 0000000000..a21a9eb9d6 --- /dev/null +++ b/test/Dockerfile @@ -0,0 +1,25 @@ +FROM debian:8.5 +MAINTAINER Vic Iglesias + +ENV CLOUDSDK_CORE_DISABLE_PROMPTS 1 +ENV PATH $WORKDIR/google-cloud-sdk/bin:$PATH +ENV HELM_VERSION=v2.0.0-alpha.3 +ENV GOOGLE_CLOUD_SDK_VERSION=123.0.0 +ENV GOOGLE_PROJECT=kubernetes-charts-ci + +WORKDIR /opt +RUN apt-get update -y +RUN apt-get install -y jq wget python git +RUN wget -q https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${GOOGLE_CLOUD_SDK_VERSION}-linux-x86_64.tar.gz +RUN tar zxfv google-cloud-sdk-${GOOGLE_CLOUD_SDK_VERSION}-linux-x86_64.tar.gz +RUN ./google-cloud-sdk/install.sh +ENV PATH /opt/google-cloud-sdk/bin:$PATH +RUN gcloud components install kubectl +RUN gcloud config set project ${GOOGLE_PROJECT} + + +RUN wget https://storage.googleapis.com/kubernetes-charts-ci/helm/helm-${HELM_VERSION}-linux-amd64.tar +RUN tar xfv helm-${HELM_VERSION}-linux-amd64.tar +ENV PATH /opt/linux-amd64/:$PATH +VOLUME /src +WORKDIR /src diff --git a/test/changed.sh b/test/changed.sh new file mode 100755 index 0000000000..ff087bff85 --- /dev/null +++ b/test/changed.sh @@ -0,0 +1,9 @@ +#!/bin/bash -xe +UPSTREAM_BRANCH="upstream/master" + +CHANGED_FOLDERS=`git diff --name-only ${UPSTREAM_BRANCH} | grep -v test | grep / | awk -F/ '{print $1"/"$2}' | uniq` +/opt/linux-amd64/helm init --client-only + +for directory in ${CHANGED_FOLDERS}; do + /opt/linux-amd64/helm lint ${directory} +done diff --git a/test/e2e.sh b/test/e2e.sh index a6debd639d..45da8de71b 100644 --- a/test/e2e.sh +++ b/test/e2e.sh @@ -1,2 +1,3 @@ -#!/bin/bash +#!/bin/bash -xe +docker run -v `pwd`:/src gcr.io/kubernetes-charts-ci/test-image:v1.4 /src/test/changed.sh echo "Done Testing!" From 13881c62ba0406be12db93131ed6b7d468e33d7c Mon Sep 17 00:00:00 2001 From: Vic Iglesias Date: Wed, 31 Aug 2016 01:10:15 -0700 Subject: [PATCH 2/3] Add license headers to test scripts --- test/changed.sh | 14 ++++++++++++++ test/e2e.sh | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/test/changed.sh b/test/changed.sh index ff087bff85..37b318f2db 100755 --- a/test/changed.sh +++ b/test/changed.sh @@ -1,4 +1,18 @@ #!/bin/bash -xe +# Copyright 2016 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +#     http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + UPSTREAM_BRANCH="upstream/master" CHANGED_FOLDERS=`git diff --name-only ${UPSTREAM_BRANCH} | grep -v test | grep / | awk -F/ '{print $1"/"$2}' | uniq` diff --git a/test/e2e.sh b/test/e2e.sh index 45da8de71b..d7fc0e6059 100644 --- a/test/e2e.sh +++ b/test/e2e.sh @@ -1,3 +1,17 @@ #!/bin/bash -xe +# Copyright 2016 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +#     http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + docker run -v `pwd`:/src gcr.io/kubernetes-charts-ci/test-image:v1.4 /src/test/changed.sh echo "Done Testing!" From 8ff74bedca943d5c462377b704f2895698b6565b Mon Sep 17 00:00:00 2001 From: Vic Iglesias Date: Wed, 31 Aug 2016 01:21:09 -0700 Subject: [PATCH 3/3] Update license headers --- test/Dockerfile | 15 ++++++++++++++- test/changed.sh | 2 +- test/e2e.sh | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/test/Dockerfile b/test/Dockerfile index a21a9eb9d6..079c367c97 100644 --- a/test/Dockerfile +++ b/test/Dockerfile @@ -1,5 +1,18 @@ +# Copyright 2016 The Kubernetes Authors All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +#     http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + FROM debian:8.5 -MAINTAINER Vic Iglesias ENV CLOUDSDK_CORE_DISABLE_PROMPTS 1 ENV PATH $WORKDIR/google-cloud-sdk/bin:$PATH diff --git a/test/changed.sh b/test/changed.sh index 37b318f2db..93189498ad 100755 --- a/test/changed.sh +++ b/test/changed.sh @@ -1,5 +1,5 @@ #!/bin/bash -xe -# Copyright 2016 Google Inc. +# Copyright 2016 The Kubernetes Authors All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/e2e.sh b/test/e2e.sh index d7fc0e6059..996f0c7fe5 100644 --- a/test/e2e.sh +++ b/test/e2e.sh @@ -1,5 +1,5 @@ #!/bin/bash -xe -# Copyright 2016 Google Inc. +# Copyright 2016 The Kubernetes Authors All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.