Skip to content

Commit

Permalink
Add hooks to do strict license checking when building on stable branc…
Browse files Browse the repository at this point in the history
…hes/releases
  • Loading branch information
Sandeep Sharma committed Apr 21, 2018
1 parent d648ec2 commit 68baf0a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ script:
- |
if [[ "$TRAVIS_BRANCH" == *"-stable" ]]; then
export CTLR_VERSION=v$(echo $TRAVIS_BRANCH | sed s/-stable//g)
export LICENSE_STRICT=false
elif [[ "$TRAVIS_BRANCH" =~ ^v[0-9]+\.[0-9]+\.[0-9]* ]]; then
va=( ${TRAVIS_BRANCH//./ } ) # replace decimals and split into array
export CTLR_VERSION="${va[0]}.${va[1]}"
export LICENSE_STRICT=true
else
export CTLR_VERSION=$TRAVIS_BRANCH
export LICENSE_STRICT=false
fi
- export CLEAN_BUILD=true
- export BASE_OS=alpine
Expand Down
19 changes: 17 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,23 @@ export BUILD_INFO := $(shell ./build-tools/version-tool build-info)

GO_BUILD_FLAGS=-v -ldflags "-extldflags \"-static\" -X main.version=$(BUILD_VERSION) -X main.buildInfo=$(BUILD_INFO)"

# Allow users to pass in BASE_OS build options (alpine or rhel7)
# Allow users to pass in BASE_OS build options (alpine or rhel7)
BASE_OS ?= alpine

# This is for builds not triggered through Travis CI
ifndef LICENSE_STRICT
LICENSE_STRICT=false
endif

# Flag for level of license approval check
# (default if no flag is passed is devel)
LIC_FLAG=

# If strict license approval check is desired, pass the corresponding flag
# to Attributions Generator on command line
ifeq ($(LICENSE_STRICT), true)
LIC_FLAG=--al release
endif

all: local-build

Expand Down Expand Up @@ -135,7 +149,8 @@ pip_attributions.json: always-build
--requirements=requirements.txt \
--project-path=$(CURDIR) \


docs/_static/ATTRIBUTIONS.md: flatfile_attributions.json golang_attributions.json pip_attributions.json
./build-tools/attributions-generator.sh \
node /frontEnd/frontEnd.js --pd $(CURDIR)
node /frontEnd/frontEnd.js --pd $(CURDIR) $(LIC_FLAG)
mv ATTRIBUTIONS.md $@

0 comments on commit 68baf0a

Please sign in to comment.