Skip to content

Commit

Permalink
chore(check): Add license-check for .go , .sh , Dockerfile and Makefi…
Browse files Browse the repository at this point in the history
…le (#205)


Signed-off-by: ajeetrai707 <ajeetrai707@gmail.com>
  • Loading branch information
ajeetrai7 authored Sep 8, 2020
1 parent e40026c commit 27fe7e3
Show file tree
Hide file tree
Showing 10 changed files with 115 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ install:
fi
- make bootstrap
- make format
- make license-check
- make golint
- 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/
Expand Down
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export DBUILD_ARGS=--build-arg DBUILD_DATE=${DBUILD_DATE} --build-arg DBUILD_REP
CSI_DRIVER=zfs-driver

.PHONY: all
all: test manifests zfs-driver-image
all: license-check test manifests zfs-driver-image

.PHONY: clean
clean:
Expand Down Expand Up @@ -246,3 +246,16 @@ golint:
@echo "Completed golint no recommendations !!"
@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
13 changes: 13 additions & 0 deletions buildscripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
#!/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.
set -e

Expand Down
14 changes: 14 additions & 0 deletions buildscripts/test-cov.sh
Original file line number Diff line number Diff line change
@@ -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

set -e
Expand Down
3 changes: 2 additions & 1 deletion buildscripts/tools.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// +build tools

/*
Copyright 2019 The Kubernetes Authors.
copyright 2020 the kubernetes authors.
licensed under the apache license, version 2.0 (the "license");
Expand All @@ -16,7 +17,7 @@ see the license for the specific language governing permissions and
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

import _ "k8s.io/code-generator"
13 changes: 13 additions & 0 deletions buildscripts/zfs-driver/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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

set -ex
Expand Down
16 changes: 16 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
@@ -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

import (
Expand Down
15 changes: 15 additions & 0 deletions pkg/zfs/mount.go
Original file line number Diff line number Diff line change
@@ -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

import (
Expand Down
13 changes: 13 additions & 0 deletions upgrade/cleanup.sh
Original file line number Diff line number Diff line change
@@ -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

set -e
Expand Down
14 changes: 14 additions & 0 deletions upgrade/upgrade.sh
Original file line number Diff line number Diff line change
@@ -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

# do not provision/deprovision anything while running the upgrade script.
Expand Down

0 comments on commit 27fe7e3

Please sign in to comment.