mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-09-18 13:22:17 +00:00
Simplify precommit.
This commit is contained in:
@@ -12,9 +12,8 @@ function removeBin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function installTools {
|
function installTools {
|
||||||
make install-tools
|
make install-tools
|
||||||
MDRIP=$(go env GOPATH)/bin/mdrip
|
ls -C1 -g -G -h $(go env GOPATH)/bin
|
||||||
ls -l $(go env GOPATH)/bin
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function runFunc {
|
function runFunc {
|
||||||
@@ -50,16 +49,16 @@ function testExamplesAgainstLatestKustomizeRelease {
|
|||||||
echo "Installing latest kustomize from $latest"
|
echo "Installing latest kustomize from $latest"
|
||||||
(cd ~; GO111MODULE=on go install $latest)
|
(cd ~; GO111MODULE=on go install $latest)
|
||||||
|
|
||||||
$MDRIP --mode test \
|
mdrip --mode test \
|
||||||
--label testAgainstLatestRelease examples
|
--label testAgainstLatestRelease examples
|
||||||
|
|
||||||
# TODO: make work for non-linux
|
# TODO: make work for non-linux
|
||||||
if onLinuxAndNotOnTravis; then
|
if onLinuxAndNotOnTravis; then
|
||||||
echo "On linux, and not on travis, so running the notravis example tests."
|
echo "On linux, and not on travis, so running the notravis example tests."
|
||||||
|
|
||||||
# Requires helm.
|
# Requires helm.
|
||||||
make $(go env GOPATH)/bin/helm
|
make $(go env GOPATH)/bin/helm
|
||||||
$MDRIP --mode test \
|
mdrip --mode test \
|
||||||
--label helmtest examples/chart.md
|
--label helmtest examples/chart.md
|
||||||
fi
|
fi
|
||||||
echo "Example tests passed against $latest"
|
echo "Example tests passed against $latest"
|
||||||
@@ -74,32 +73,31 @@ function testExamplesAgainstLocalHead {
|
|||||||
# To test examples of unreleased features, add
|
# To test examples of unreleased features, add
|
||||||
# examples with code blocks annotated with some
|
# examples with code blocks annotated with some
|
||||||
# label _other than_ @testAgainstLatestRelease.
|
# label _other than_ @testAgainstLatestRelease.
|
||||||
$MDRIP --mode test \
|
mdrip --mode test \
|
||||||
--label testAgainstLatestRelease examples
|
--label testAgainstLatestRelease examples
|
||||||
echo "Example tests passed against HEAD"
|
echo "Example tests passed against HEAD"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Having this set might contradict the Makefile,
|
|
||||||
# so assure it's unset.
|
# Don't override go's notion of where to
|
||||||
|
# install stuff.
|
||||||
unset GOPATH
|
unset GOPATH
|
||||||
|
|
||||||
# With GOPATH now undefined, this most likely
|
# Ease running the tooling installed by 'go';
|
||||||
# puts $HOME/go/bin on the path. Regardless,
|
# mdrip, pluginator, stringer, etc.
|
||||||
# subsequent go tool installs will be placing
|
|
||||||
# binaries in this location.
|
|
||||||
PATH=$(go env GOPATH)/bin:$PATH
|
PATH=$(go env GOPATH)/bin:$PATH
|
||||||
|
|
||||||
# Make sure we run in the root of the repo and
|
# Assure that this script runs from the repo
|
||||||
# therefore run the tests on all packages
|
# root, since some tests might rely on it.
|
||||||
base_dir="$( cd "$(dirname "$0")/.." && pwd )"
|
base_dir="$( cd "$(dirname "$0")/.." && pwd )"
|
||||||
cd "$base_dir" || {
|
cd "$base_dir" || {
|
||||||
echo "Cannot cd to '$base_dir'. Aborting." >&2
|
echo "Cannot cd to '$base_dir'. Aborting." >&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "HOME=$HOME"
|
echo "HOME = $HOME"
|
||||||
echo "PATH=$PATH"
|
echo "PATH = $PATH"
|
||||||
echo pwd=`pwd`
|
echo " PWD = $PWD"
|
||||||
echo " "
|
echo " "
|
||||||
echo "Working..."
|
echo "Working..."
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user