Merge pull request #293 from cpuguy83/ci_validate_vendor
Validate deps in CI
This commit is contained in:
@@ -17,7 +17,7 @@ jobs:
|
|||||||
echo 'export KUBECONFIG=${outputPathKubeConfigFile}' >> $BASH_ENV
|
echo 'export KUBECONFIG=${outputPathKubeConfigFile}' >> $BASH_ENV
|
||||||
- run:
|
- run:
|
||||||
name: Dependencies
|
name: Dependencies
|
||||||
command: go get -v -t -d ./...
|
command: scripts/validate/dep.sh
|
||||||
- run:
|
- run:
|
||||||
name: Build
|
name: Build
|
||||||
command: V=1 make build
|
command: V=1 make build
|
||||||
|
|||||||
16
scripts/validate/dep.sh
Executable file
16
scripts/validate/dep.sh
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
validate_dep() {
|
||||||
|
dep ensure
|
||||||
|
nChanges=$(git status --porcelain -u | wc -l)
|
||||||
|
[ $nChanges -eq 0 ]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
validate_dep || {
|
||||||
|
ret=$?
|
||||||
|
echo '`dep ensure` was not run. Make sure dependency changes are committed to the repository.'
|
||||||
|
echo 'You may also need to check that all deps are pinned to a commit or tag instead of a branch or HEAD.'
|
||||||
|
echo 'Check Gopkg.toml and Gopkg.lock'
|
||||||
|
git diff Gopkg.toml Gopkg.lock
|
||||||
|
exit $ret
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user