From 8c9f01ef533395a44102ecb255121a4a7854b0be Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Mon, 8 May 2017 14:24:23 -0700 Subject: [PATCH] scripts: add 'BOM' update script Need this script when we add external dependencies. Signed-off-by: Gyu-Ho Lee --- bill-of-materials.json | 10 +++++----- scripts/updatebom.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 5 deletions(-) create mode 100755 scripts/updatebom.sh diff --git a/bill-of-materials.json b/bill-of-materials.json index 3fe6c7301..e45c23bcc 100644 --- a/bill-of-materials.json +++ b/bill-of-materials.json @@ -1,4 +1,9 @@ [ + { + "project": "bitbucket.org/ww/goautoneg", + "license": "BSD 3-clause \"New\" or \"Revised\" License", + "confidence": 1 + }, { "project": "github.com/beorn7/perks/quantile", "license": "MIT License", @@ -203,10 +208,5 @@ "project": "gopkg.in/yaml.v2", "license": "Apache License 2.0 and MIT License", "confidence": 1 - }, - { - "project": "bitbucket.org/ww/goautoneg", - "license": "BSD 3-clause \"New\" or \"Revised\" License", - "confidence": 1 } ] diff --git a/scripts/updatebom.sh b/scripts/updatebom.sh new file mode 100755 index 000000000..08f59f280 --- /dev/null +++ b/scripts/updatebom.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +set -e + +if ! [[ "$0" =~ "scripts/updatebom.sh" ]]; then + echo "must be run from repository root" + exit 255 +fi + +echo "installing 'bill-of-materials.json'" +go get -v -u github.com/coreos/license-bill-of-materials + +echo "setting up GOPATH" +rm -rf ./gopath +mkdir ./gopath +mv ./cmd/vendor ./gopath/src + +echo "generating bill-of-materials.json" +GOPATH=`pwd`/gopath license-bill-of-materials \ + --override-file ./bill-of-materials.override.json \ + github.com/coreos/etcd github.com/coreos/etcd/etcdctl > bill-of-materials.json + +echo "reverting GOPATH,vendor" +mv ./gopath/src ./cmd/vendor +rm -rf ./gopath + +echo "generated bill-of-materials.json" +