updatebom.sh 666 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env bash
  2. set -e
  3. if ! [[ "$0" =~ "scripts/updatebom.sh" ]]; then
  4. echo "must be run from repository root"
  5. exit 255
  6. fi
  7. echo "installing 'bill-of-materials.json'"
  8. go get -v -u github.com/coreos/license-bill-of-materials
  9. echo "setting up GOPATH"
  10. rm -rf ./gopath
  11. mkdir ./gopath
  12. mv ./cmd/vendor ./gopath/src
  13. echo "generating bill-of-materials.json"
  14. GOPATH=`pwd`/gopath license-bill-of-materials \
  15. --override-file ./bill-of-materials.override.json \
  16. github.com/coreos/etcd github.com/coreos/etcd/etcdctl > bill-of-materials.json
  17. echo "reverting GOPATH,vendor"
  18. mv ./gopath/src ./cmd/vendor
  19. rm -rf ./gopath
  20. echo "generated bill-of-materials.json"