فهرست منبع

Merge pull request #351 from jonboulle/tests

*: add license header test + travis badge
Eugene Yakubovich 9 سال پیش
والد
کامیت
92bb48d912
7فایلهای تغییر یافته به همراه70 افزوده شده و 2 حذف شده
  1. 3 2
      .travis.yml
  2. 2 0
      README.md
  3. 14 0
      backend/alloc/alloc.go
  4. 14 0
      backend/awsvpc/filter.go
  5. 14 0
      backend/gce/api.go
  6. 14 0
      backend/manager.go
  7. 9 0
      test

+ 3 - 2
.travis.yml

@@ -1,9 +1,10 @@
 language: go
 go:
-  - 1.3
+  - 1.4
+  - 1.5
 
 install:
- - go get code.google.com/p/go.tools/cmd/cover
+ - go get golang.org/x/tools/cmd/cover 
 
 script:
  - ./test

+ 2 - 0
README.md

@@ -2,6 +2,8 @@
 
 ![flannel Logo](logos/flannel-horizontal-color.png)
 
+[![Build Status](https://travis-ci.org/coreos/flannel.png?branch=master)](https://travis-ci.org/coreos/flannel)
+
 flannel is a virtual network that gives a subnet to each host for use with container runtimes.
 
 Platforms like Google's Kubernetes assume that each container (pod) has a unique, routable IP inside the cluster.

+ 14 - 0
backend/alloc/alloc.go

@@ -1,3 +1,17 @@
+// Copyright 2015 flannel authors
+//
+// 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.
+
 package alloc
 
 import (

+ 14 - 0
backend/awsvpc/filter.go

@@ -1,3 +1,17 @@
+// Copyright 2015 flannel authors
+//
+// 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.
+
 package awsvpc
 
 import "github.com/coreos/flannel/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2"

+ 14 - 0
backend/gce/api.go

@@ -1,3 +1,17 @@
+// Copyright 2015 flannel authors
+//
+// 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.
+
 package gce
 
 import (

+ 14 - 0
backend/manager.go

@@ -1,3 +1,17 @@
+// Copyright 2015 flannel authors
+//
+// 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.
+
 package backend
 
 import (

+ 9 - 0
test

@@ -47,4 +47,13 @@ if [ -n "${fmtRes}" ]; then
 	exit 255
 fi
 
+echo "Checking for license header..."
+licRes=$(for file in $(find . -type f -iname '*.go' ! -path './Godeps/*'); do
+		head -n3 "${file}" | grep -Eq "(Copyright|generated|GENERATED)" || echo -e "  ${file}"
+	done;)
+if [ -n "${licRes}" ]; then
+	echo -e "license header checking failed:\n${licRes}"
+	exit 255
+fi
+
 echo "Success"