chore(check): Add license-check for .go , .sh , Dockerfile and Makefile (#205)

Signed-off-by: ajeetrai707 <ajeetrai707@gmail.com>
This commit is contained in:
ajeet_rai 2020-09-08 20:37:59 +05:30 committed by GitHub
parent e40026c98a
commit 27fe7e3b06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 115 additions and 2 deletions

View file

@ -32,6 +32,7 @@ install:
fi fi
- make bootstrap - make bootstrap
- make format - make format
- make license-check
- make golint - make golint
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.17.4/bin/linux/amd64/kubectl - curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.17.4/bin/linux/amd64/kubectl
&& chmod +x kubectl && sudo mv kubectl /usr/local/bin/ && chmod +x kubectl && sudo mv kubectl /usr/local/bin/

View file

@ -93,7 +93,7 @@ export DBUILD_ARGS=--build-arg DBUILD_DATE=${DBUILD_DATE} --build-arg DBUILD_REP
CSI_DRIVER=zfs-driver CSI_DRIVER=zfs-driver
.PHONY: all .PHONY: all
all: test manifests zfs-driver-image all: license-check test manifests zfs-driver-image
.PHONY: clean .PHONY: clean
clean: clean:
@ -246,3 +246,16 @@ golint:
@echo "Completed golint no recommendations !!" @echo "Completed golint no recommendations !!"
@echo "--------------------------------" @echo "--------------------------------"
@echo "" @echo ""
.PHONY: license-check
license-check:
@echo "--> Checking license header..."
@licRes=$$(for file in $$(find . -type f -regex '.*\.sh\|.*\.go\|.*Docker.*\|.*\Makefile*' ! -path './vendor/*' ) ; do \
awk 'NR<=5' $$file | grep -Eq "(Copyright|generated|GENERATED)" || echo $$file; \
done); \
if [ -n "$${licRes}" ]; then \
echo "license header checking failed:"; echo "$${licRes}"; \
exit 1; \
fi
@echo "--> Done checking license."
@echo

View file

@ -1,5 +1,18 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright © 2020 The OpenEBS 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.
# This script builds the application from source for multiple platforms. # This script builds the application from source for multiple platforms.
set -e set -e

View file

@ -1,3 +1,17 @@
# Copyright © 2020 The OpenEBS 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.
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e

View file

@ -1,6 +1,7 @@
// +build tools // +build tools
/* /*
Copyright 2019 The Kubernetes Authors.
copyright 2020 the kubernetes authors. copyright 2020 the kubernetes authors.
licensed under the apache license, version 2.0 (the "license"); licensed under the apache license, version 2.0 (the "license");
@ -16,7 +17,7 @@ see the license for the specific language governing permissions and
limitations under the license. limitations under the license.
*/ */
// this package imports things required by build scripts, to force `go mod` to see them as dependencies // tools package imports things required by build scripts, to force `go mod` to see them as dependencies
package tools package tools
import _ "k8s.io/code-generator" import _ "k8s.io/code-generator"

View file

@ -1,3 +1,16 @@
# Copyright © 2020 The OpenEBS 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.
#!/bin/sh #!/bin/sh
set -ex set -ex

View file

@ -1,3 +1,19 @@
/*
Copyright © 2020 The OpenEBS 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 main package main
import ( import (

View file

@ -1,3 +1,18 @@
/*
Copyright © 2020 The OpenEBS 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 zfs package zfs
import ( import (

View file

@ -1,3 +1,16 @@
# Copyright © 2020 The OpenEBS 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.
#!/bin/bash #!/bin/bash
set -e set -e

View file

@ -1,3 +1,17 @@
# Copyright © 2020 The OpenEBS 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.
#!/bin/bash #!/bin/bash
# do not provision/deprovision anything while running the upgrade script. # do not provision/deprovision anything while running the upgrade script.