diff --git a/.circleci/config.yml b/.circleci/config.yml index 47047e282..183f9bee0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,7 +17,7 @@ jobs: echo 'export KUBECONFIG=${outputPathKubeConfigFile}' >> $BASH_ENV - run: name: Dependencies - command: go get -v -t -d ./... + command: scripts/validate/dep.sh - run: name: Build command: V=1 make build diff --git a/scripts/validate/dep.sh b/scripts/validate/dep.sh new file mode 100755 index 000000000..ab03f5063 --- /dev/null +++ b/scripts/validate/dep.sh @@ -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 +} \ No newline at end of file