Skip to content
This repository was archived by the owner on Oct 31, 2021. It is now read-only.

Commit 710351b

Browse files
committed
Adding some basic license scanning.
1 parent b9b0063 commit 710351b

File tree

4 files changed

+31
-7
lines changed

4 files changed

+31
-7
lines changed

.github/workflows/go.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ jobs:
3030
--health-retries 5
3131
steps:
3232
- uses: actions/checkout@v2
33-
- name: Dependencies
34-
run: make dependencies
35-
- name: Build
36-
run: make build
33+
- name: Depdendencies, Build, Licenses
34+
run: make license
3735
- name: Setup Schema
3836
run: make apply-schema-ci
3937
- name: Test

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ ifndef POSTGRES_HOST
2121
POSTGRES_HOST=localhost
2222
endif
2323

24-
default: dependencies build test
24+
default: build test
2525

26-
dependencies:
26+
dependencies: go.mod go.sum
2727
go get ./...
2828

29-
build:
29+
build: dependencies $(wildcard $(PWD)/pkg/**/*.go)
3030
go build -o $(LOCAL_BIN_DIR)/monetr $(MONETR_CLI_PACKAGE)
3131

3232
test:

Makefile.local

+17
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ JQ=$(LOCAL_BIN)/jq
1313
KUBECTL=minikube kubectl --
1414
SPLIT_YAML=kubernetes-split-yaml
1515
YQ=$(LOCAL_BIN)/yq
16+
LICENSE=$(LOCAL_BIN)/golicense
1617
VAULT=vault
1718
MKCERT=mkcert
1819
PGO=$(LOCAL_BIN)/pgo
@@ -267,6 +268,18 @@ install-$(YQ): $(LOCAL_BIN) $(LOCAL_TMP)
267268
mv $(YQ_DIR)/yq_$(OS)_$(ARCH) $(YQ)
268269
rm -rf $(YQ_DIR) || true
269270

271+
$(LICENSE):
272+
@if [ ! -f "$(LICENSE)" ]; then make install-$(LICENSE); fi
273+
274+
LICENSE_REPO=https://github.com/mitchellh/golicense.git
275+
LICENSE_TMP=$(LOCAL_TMP)/golicense
276+
install-$(LICENSE): $(LOCAL_BIN) $(LOCAL_TMP)
277+
$(call infoMsg,Installing golicense to $(LICENSE))
278+
rm -rf $(LICENSE_TMP) || true
279+
git clone $(LICENSE_REPO) $(LICENSE_TMP)
280+
cd $(LICENSE_TMP) && go build -o $(LICENSE) .
281+
rm -rf $(LICENSE_TMP) || true
282+
270283

271284
MKCERT_REPO=https://github.com/FiloSottile/mkcert
272285
MKCERT_DIR=$(LOCAL_TMP)/$(MKCERT)
@@ -542,4 +555,8 @@ mail-mini: $(VALUES) $(YQ)
542555
@echo "mailhog is now accessible at: https://mail.$(LOCAL_DOMAIN)"
543556
@echo "\033[0;31m#################################################################################\033[0m"
544557

558+
license: $(LICENSE) build
559+
- $(LICENSE) $(PWD)/licenses.hcl $(LOCAL_BIN)/monetr
560+
561+
545562

licenses.hcl

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
allow = [
2+
"Apache-2.0",
3+
"BSD-2-Clause",
4+
"BSD-3-Clause",
5+
"MIT",
6+
"MPL-2.0",
7+
"Unlicense",
8+
]
9+
deny = []

0 commit comments

Comments
 (0)