Skip to content

Commit 9d92815

Browse files
authored
Add CC license (#62)
* Add CC license * Delete unused .README.md * Use standard MAKEFILE_LIST * configurable help targets * fix readme whitespace
1 parent 2d26d2e commit 9d92815

File tree

8 files changed

+80
-73
lines changed

8 files changed

+80
-73
lines changed

.README.md

Lines changed: 0 additions & 58 deletions
This file was deleted.

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ export SELF ?= make
44
export PATH := $(BUILD_HARNESS_PATH)/vendor:$(PATH)
55
export DOCKER_BUILD_FLAGS ?=
66

7+
ifeq ($(CURDIR),$(realpath $(BUILD_HARNESS_PATH)))
78
# List of targets the `readme` target should call before generating the readme
89
export README_DEPS ?= docs/targets.md
10+
export DEFAULT_HELP_TARGET = help/all
11+
endif
912

1013
# Import Makefiles into current context
1114
include $(BUILD_HARNESS_PATH)/Makefile.*

Makefile.helpers

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ EDITOR ?= vim
66

77
SHELL = /bin/bash
88

9+
DEFAULT_HELP_TARGET ?= help
10+
911
green = $(shell echo -e '\x1b[32;01m$1\x1b[0m')
1012
yellow = $(shell echo -e '\x1b[33;01m$1\x1b[0m')
1113
red = $(shell echo -e '\x1b[33;31m$1\x1b[0m')
@@ -21,12 +23,20 @@ define assert-unset
2123
@[ -z "$($1)" ] || (echo "$(1) should not be defined in $(@)"; exit 1)
2224
endef
2325

24-
default:: help
26+
default:: $(DEFAULT_HELP_TARGET)
2527
@exit 0
2628

2729
.PHONY : help
2830
## This help screen
2931
help:
32+
@$(SELF) help/generate MAKEFILE_LIST="Makefile $(BUILD_HARNESS_PATH)/Makefile.helpers"
33+
34+
## Display help for all targets
35+
help/all:
36+
@$(SELF) help/generate MAKEFILE_LIST="$(MAKEFILE_LIST)"
37+
38+
# Generate help output from MAKEFILE_LIST
39+
help/generate:
3040
@printf "Available targets:\n\n"
3141
@awk '/^[a-zA-Z\-\_0-9%:\\\/]+:/ { \
3242
helpMessage = match(lastLine, /^## (.*)/); \

README.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@
66

77

88
This `build-harness` is a collection of Makefiles to facilitate building Golang projects, Dockerfiles, Helm charts, and more.
9-
It's designed to work with CI/CD systems such as Travis CI, CircleCI and Jenkins.This project is part of our comprehensive ["SweetOps"](https://docs.cloudposse.com) approach towards DevOps.
9+
It's designed to work with CI/CD systems such as Travis CI, CircleCI and Jenkins.
1010

1111

12-
It's 100% Open Source and licensed under [APACHE2](LICENSE).
12+
---
13+
14+
This project is part of our comprehensive ["SweetOps"](https://docs.cloudposse.com) approach towards DevOps.
15+
16+
17+
It's 100% Open Source and licensed under the [APACHE2](LICENSE).
18+
1319

1420

1521

@@ -27,7 +33,9 @@ This automatically exposes many new targets that you can leverage throughout you
2733

2834
Run `make help` for a list of available targets.
2935

30-
**NOTE:** the `/` is interchangable with the `:` in target names## Quick Start
36+
**NOTE:** the `/` is interchangable with the `:` in target names
37+
38+
## Quick Start
3139

3240
Here's how to get started...
3341

@@ -98,6 +106,7 @@ Available targets:
98106
helm/toolbox/upsert Install or upgrade helm tiller
99107
helmfile/install Install helmfile
100108
help This help screen
109+
help/all Display help for all targets
101110
jenkins/run-job-with-tag Run a Jenkins Job with $(TAG)
102111
make/lint Lint all makefiles
103112
packages/delete Delete packages
@@ -178,13 +187,15 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
178187
179188
**NOTE:** Be sure to merge the latest changes from "upstream" before making a pull request!
180189
190+
## Copyright
191+
192+
Copyright © 2017-2018 [Cloud Posse, LLC](https://cloudposse.com)
193+
181194
182195
## License
183196
184197
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
185198
186-
Copyright © 2017-2018 [Cloud Posse, LLC](https://cloudposse.com)
187-
188199
See [LICENSE](LICENSE) for full details.
189200
190201
Licensed to the Apache Software Foundation (ASF) under one
@@ -205,6 +216,10 @@ See [LICENSE](LICENSE) for full details.
205216
under the License.
206217
207218
219+
## Trademarks
220+
221+
All other trademarks referenced herein are the property of their respective owners.
222+
208223
## About
209224
210225
This project is maintained and funded by [Cloud Posse, LLC][website]. Like it? Please let us know at <hello@cloudposse.com>

docs/targets.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Available targets:
5151
helm/toolbox/upsert Install or upgrade helm tiller
5252
helmfile/install Install helmfile
5353
help This help screen
54+
help/all Display help for all targets
5455
jenkins/run-job-with-tag Run a Jenkins Job with $(TAG)
5556
make/lint Lint all makefiles
5657
packages/delete Delete packages

modules/docs/Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1+
.PHONY : docs
2+
docs/deps::
3+
@mkdir -p docs
4+
15
.PHONY : docs/targets.md
26
## Update `docs/targets.md` from `make help`
3-
docs/targets.md:
7+
docs/targets.md: docs/deps
48
@( \
59
echo "## Makefile Targets"; \
610
echo '```'; \
7-
$(SELF) --no-print-directory --quiet --silent help | sed $$'s,\x1b\\[[0-9;]*[a-zA-Z],,g'; \
11+
$(SELF) --no-print-directory --quiet --silent $(DEFAULT_HELP_TARGET) | sed $$'s,\x1b\\[[0-9;]*[a-zA-Z],,g'; \
812
echo '```'; \
913
) > $@
1014

1115
.PHONY : docs/terraform.md
1216
## Update `docs/terraform.md` from `terraform-docs`
13-
docs/terraform.md: packages/install/terraform-docs
17+
docs/terraform.md: docs/deps packages/install/terraform-docs
1418
@terraform-docs md . > $@

modules/readme/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ readme/lint:
2828

2929
## Create README.md by building it from README.yaml
3030
readme/build: $(README_DEPS)
31-
@mkdir -p docs
3231
@gomplate --file $(README_TEMPLATE_FILE) \
3332
--out $(README_FILE) \
3433
--datasource config=$(README_YAML) \

templates/README.md

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,19 @@
1010

1111
{{ if has (ds "config") "description" }}
1212
{{(ds "config").description }}
13-
{{- end -}}
13+
{{ end }}
14+
15+
---
1416

1517
This project is part of our comprehensive ["SweetOps"](https://docs.cloudposse.com) approach towards DevOps.
1618

1719
{{ if eq (ds "config").license "APACHE2" }}
18-
It's 100% Open Source and licensed under [APACHE2](LICENSE).
20+
It's 100% Open Source and licensed under the [APACHE2](LICENSE).
21+
{{ end }}
22+
{{ if eq (ds "config").license "CC-BY-NC-SA-4.0" }}
23+
It's 100% Open Source and licensed under the [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](LICENSE).
24+
25+
<a href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img title="Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License" src="static/images/cc-by-nc-sa.png" width="150" /></a>
1926
{{ end }}
2027

2128
{{ if has (ds "config") "usage" }}
@@ -24,7 +31,7 @@ It's 100% Open Source and licensed under [APACHE2](LICENSE).
2431
{{ (ds "config").usage -}}
2532
{{ end }}
2633

27-
{{- if has (ds "config") "quickstart" -}}
34+
{{ if has (ds "config") "quickstart" -}}
2835
## Quick Start
2936

3037
{{ (ds "config").quickstart -}}
@@ -94,13 +101,15 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
94101

95102
**NOTE:** Be sure to merge the latest changes from "upstream" before making a pull request!
96103

104+
## Copyright
105+
106+
Copyright © 2017-{{ time.Now.Year }} [Cloud Posse, LLC](https://cloudposse.com)
107+
97108
{{ if eq (ds "config").license "APACHE2" }}
98109
## License
99110

100111
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
101112

102-
Copyright © 2017-{{ time.Now.Year }} [Cloud Posse, LLC](https://cloudposse.com)
103-
104113
See [LICENSE](LICENSE) for full details.
105114

106115
Licensed to the Apache Software Foundation (ASF) under one
@@ -120,6 +129,30 @@ See [LICENSE](LICENSE) for full details.
120129
specific language governing permissions and limitations
121130
under the License.
122131
{{ end }}
132+
{{ if eq (ds "config").license "CC-BY-NC-SA-4.0" }}
133+
## License
134+
135+
[![License](https://img.shields.io/badge/License-CC%20BY%20NC%20SA%204.0-blue.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
136+
137+
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/"><img title="Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License" src="https://docs.cloudposse.com/images/cc-by-nc-sa.png" width="150" /></a>
138+
139+
This material may only be distributed subject to the terms and conditions set forth in the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License or later with the restrictions noted below (the latest version of the license is presently available at <http://creativecommons.org/licenses/by-nc-sa/4.0/>).
140+
141+
**Attribution** You must attribute the work in the manner specified by the author or licensor.
142+
143+
**Noncommercial** The licensor permits others to copy, distribute and transmit the work. In return, licensees may not use the work for commercial purposes — unless they get the licensor's permission.
144+
145+
**Share Alike** The licensor permits others to distribute derivative works only under the same license or one compatible with the one that governs the licensor's work.
146+
147+
## Distribution
148+
149+
Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder.
150+
151+
Distribution of the work or derivative of the work in any standard (paper) book form for commercial purposes is prohibited unless prior permission is obtained from the copyright holder.
152+
{{ end }}
153+
## Trademarks
154+
155+
All other trademarks referenced herein are the property of their respective owners.
123156

124157
## About
125158

0 commit comments

Comments
 (0)