This is the PowerShell script to run all go tests for Kustomize on a windows based platform which mimics /build/pre-commit.sh
- (obviously) PowerShell installed
- PowerShell Core is supported
- go installed
- golangci-lint installed
- mdrip installed
This script should output to the current console and return an exit code if all tests are successful(0) or any failed(1).
Assume:
- Running a stock Windows 10 system
- Local Admin rights.
- You can open PowerShell as administrator
- You should be knowledgeable enough to pull source for packages into your GO
src
directory- Yes, this means you also need to know a bit about git usually
- Install Go - please use the msi
- If you use chocolatey - it's using the zip not msi and assumptions on where go is located are made for you.
- Open new PowerShell Administrative window
- Install golangci-lint
go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
- Install mdrip
go get github.com/monopole/mdrip
- Install golangci-lint
You should now be able to issue these commands and see comparable responses
C:\...> golangci-lint --help
Smart, fast linters runner. Run it in cloud for every GitHub pull request on https://golangci.com
...
C:\...> mdrip --help
Usage: C:\_go\bin\mdrip.exe {fileName}...
...
- In your GoRoot src
Example: C:\_go\src
- Navigate to the Kustomize
travis
directoryExample: C:\_go\src\sigs.k8s.io\kustomize\travis
- Now Execute:
.\Invoke-PreCommit.ps1
This should run all pre-commit tests thus defined in the script.