small fixes to boilerplate and integration test scripts (#3212)
Introduces hack/boilerplate/fix.sh that automatically fixes the copyright header in files.pull/3261/head
parent
c01c5545a5
commit
64e1853910
|
|
@ -115,7 +115,7 @@ def normalize_files(files):
|
|||
newfiles.append(pathname)
|
||||
for i, pathname in enumerate(newfiles):
|
||||
if not os.path.isabs(pathname):
|
||||
newfiles[i] = os.path.join(args.rootdir, pathname)
|
||||
newfiles[i] = os.path.join(rootdir, pathname)
|
||||
return newfiles
|
||||
|
||||
def get_files(extensions):
|
||||
|
|
|
|||
|
|
@ -0,0 +1,49 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright 2018 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.
|
||||
|
||||
export readonly ROOT_DIR=${1:-$(pwd)}
|
||||
|
||||
function prepend() {
|
||||
local ignore="vendor\|\_gopath\|assets.go"
|
||||
local pattern=$1
|
||||
local ref=$2
|
||||
local headers=$3
|
||||
local files=$(hack/boilerplate/boilerplate.py --rootdir ${ROOT_DIR} | grep -v "$ignore" | grep "$pattern")
|
||||
for f in ${files}; do
|
||||
echo ${f};
|
||||
local copyright="$(cat hack/boilerplate/boilerplate.${ref}.txt | sed s/YEAR/$(date +%Y)/g)"
|
||||
local file_headers=""
|
||||
|
||||
if [ "${headers}" != "" ]; then
|
||||
file_headers="$(cat ${f} | grep ${headers})"
|
||||
fi
|
||||
|
||||
if [ "${file_headers}" != "" ]; then
|
||||
fileContent="$(cat ${f} | grep -v ${headers})"
|
||||
printf '%s\n\n%s\n%s\n' "$file_headers" "${copyright}" "$fileContent" > ${f}
|
||||
else
|
||||
fileContent="$(cat ${f})"
|
||||
printf '%s\n\n%s\n' "${copyright}" "$fileContent" > ${f}
|
||||
fi
|
||||
|
||||
done
|
||||
}
|
||||
|
||||
prepend "\.go" "go" "+build"
|
||||
prepend "\.py" "py"
|
||||
prepend "\.sh" "sh" "#!"
|
||||
prepend Makefile Makefile
|
||||
prepend Dockerfile Dockerfile
|
||||
|
|
@ -36,14 +36,10 @@ fi
|
|||
|
||||
# Add the out/ directory to the PATH, for using new drivers.
|
||||
export PATH="$(pwd)/out/":$PATH
|
||||
gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/minikube-${OS_ARCH} out/
|
||||
gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/docker-machine-driver-* out/
|
||||
gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/e2e-${OS_ARCH} out/
|
||||
gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/testdata/busybox.yaml testdata/
|
||||
gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/testdata/pvc.yaml testdata/
|
||||
gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/testdata/busybox-mount-test.yaml testdata/
|
||||
gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/testdata/nginx-pod-svc.yaml testdata/
|
||||
gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/testdata/nginx-ing.yaml testdata/
|
||||
gsutil -m cp gs://minikube-builds/${MINIKUBE_LOCATION}/minikube-${OS_ARCH} out/
|
||||
gsutil -m cp gs://minikube-builds/${MINIKUBE_LOCATION}/docker-machine-driver-* out/
|
||||
gsutil -m cp gs://minikube-builds/${MINIKUBE_LOCATION}/e2e-${OS_ARCH} out/
|
||||
gsutil -m cp gs://minikube-builds/${MINIKUBE_LOCATION}/testdata/* testdata/
|
||||
|
||||
# Set the executable bit on the e2e binary and out binary
|
||||
chmod +x out/e2e-${OS_ARCH}
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ EXTRA_FLAGS="--show-libmachine-logs"
|
|||
mkdir -p out/
|
||||
|
||||
curl -L http://artifacts.ci.centos.org/minishift/minishift/master/latest/linux-amd64/minishift -o out/minishift
|
||||
gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/docker-machine-driver-* out/ || true
|
||||
gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/minikube-testing.iso out/ || true
|
||||
gsutil -m cp gs://minikube-builds/${MINIKUBE_LOCATION}/docker-machine-driver-* out/ || true
|
||||
gsutil -m cp gs://minikube-builds/${MINIKUBE_LOCATION}/minikube-testing.iso out/ || true
|
||||
|
||||
# Set the executable bit on the minishift and driver binary
|
||||
chmod +x out/minishift
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@
|
|||
# limitations under the License.
|
||||
|
||||
mkdir -p out
|
||||
gsutil.cmd cp gs://minikube-builds/$env:MINIKUBE_LOCATION/minikube-windows-amd64.exe out/
|
||||
gsutil.cmd cp gs://minikube-builds/$env:MINIKUBE_LOCATION/e2e-windows-amd64.exe out/
|
||||
gsutil.cmd cp -r gs://minikube-builds/$env:MINIKUBE_LOCATION/testdata .
|
||||
gsutil.cmd -m cp gs://minikube-builds/$env:MINIKUBE_LOCATION/minikube-windows-amd64.exe out/
|
||||
gsutil.cmd -m cp gs://minikube-builds/$env:MINIKUBE_LOCATION/e2e-windows-amd64.exe out/
|
||||
gsutil.cmd -m cp -r gs://minikube-builds/$env:MINIKUBE_LOCATION/testdata .
|
||||
|
||||
./out/minikube-windows-amd64.exe delete
|
||||
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@
|
|||
# limitations under the License.
|
||||
|
||||
mkdir -p out
|
||||
gsutil.cmd cp gs://minikube-builds/$env:MINIKUBE_LOCATION/minikube-windows-amd64.exe out/
|
||||
gsutil.cmd cp gs://minikube-builds/$env:MINIKUBE_LOCATION/e2e-windows-amd64.exe out/
|
||||
gsutil.cmd cp -r gs://minikube-builds/$env:MINIKUBE_LOCATION/testdata .
|
||||
gsutil.cmd -m cp gs://minikube-builds/$env:MINIKUBE_LOCATION/minikube-windows-amd64.exe out/
|
||||
gsutil.cmd -m cp gs://minikube-builds/$env:MINIKUBE_LOCATION/e2e-windows-amd64.exe out/
|
||||
gsutil.cmd -m cp -r gs://minikube-builds/$env:MINIKUBE_LOCATION/testdata .
|
||||
|
||||
|
||||
./out/minikube-windows-amd64.exe delete
|
||||
|
|
|
|||
Loading…
Reference in New Issue