Skip to content

Commit

Permalink
Add CC license (#62)
Browse files Browse the repository at this point in the history
* Add CC license

* Delete unused .README.md

* Use standard MAKEFILE_LIST

* configurable help targets

* fix readme whitespace
  • Loading branch information
osterman authored Jun 18, 2018
1 parent 2d26d2e commit 9d92815
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 73 deletions.
58 changes: 0 additions & 58 deletions .README.md

This file was deleted.

3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ export SELF ?= make
export PATH := $(BUILD_HARNESS_PATH)/vendor:$(PATH)
export DOCKER_BUILD_FLAGS ?=

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

# Import Makefiles into current context
include $(BUILD_HARNESS_PATH)/Makefile.*
Expand Down
12 changes: 11 additions & 1 deletion Makefile.helpers
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ EDITOR ?= vim

SHELL = /bin/bash

DEFAULT_HELP_TARGET ?= help

green = $(shell echo -e '\x1b[32;01m$1\x1b[0m')
yellow = $(shell echo -e '\x1b[33;01m$1\x1b[0m')
red = $(shell echo -e '\x1b[33;31m$1\x1b[0m')
Expand All @@ -21,12 +23,20 @@ define assert-unset
@[ -z "$($1)" ] || (echo "$(1) should not be defined in $(@)"; exit 1)
endef

default:: help
default:: $(DEFAULT_HELP_TARGET)
@exit 0

.PHONY : help
## This help screen
help:
@$(SELF) help/generate MAKEFILE_LIST="Makefile $(BUILD_HARNESS_PATH)/Makefile.helpers"

## Display help for all targets
help/all:
@$(SELF) help/generate MAKEFILE_LIST="$(MAKEFILE_LIST)"

# Generate help output from MAKEFILE_LIST
help/generate:
@printf "Available targets:\n\n"
@awk '/^[a-zA-Z\-\_0-9%:\\\/]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
Expand Down
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@


This `build-harness` is a collection of Makefiles to facilitate building Golang projects, Dockerfiles, Helm charts, and more.
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.
It's designed to work with CI/CD systems such as Travis CI, CircleCI and Jenkins.


It's 100% Open Source and licensed under [APACHE2](LICENSE).
---

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


It's 100% Open Source and licensed under the [APACHE2](LICENSE).




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

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

**NOTE:** the `/` is interchangable with the `:` in target names## Quick Start
**NOTE:** the `/` is interchangable with the `:` in target names

## Quick Start

Here's how to get started...

Expand Down Expand Up @@ -98,6 +106,7 @@ Available targets:
helm/toolbox/upsert Install or upgrade helm tiller
helmfile/install Install helmfile
help This help screen
help/all Display help for all targets
jenkins/run-job-with-tag Run a Jenkins Job with $(TAG)
make/lint Lint all makefiles
packages/delete Delete packages
Expand Down Expand Up @@ -178,13 +187,15 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
**NOTE:** Be sure to merge the latest changes from "upstream" before making a pull request!
## Copyright
Copyright © 2017-2018 [Cloud Posse, LLC](https://cloudposse.com)
## License
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
Copyright © 2017-2018 [Cloud Posse, LLC](https://cloudposse.com)
See [LICENSE](LICENSE) for full details.
Licensed to the Apache Software Foundation (ASF) under one
Expand All @@ -205,6 +216,10 @@ See [LICENSE](LICENSE) for full details.
under the License.
## Trademarks
All other trademarks referenced herein are the property of their respective owners.
## About
This project is maintained and funded by [Cloud Posse, LLC][website]. Like it? Please let us know at <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions docs/targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Available targets:
helm/toolbox/upsert Install or upgrade helm tiller
helmfile/install Install helmfile
help This help screen
help/all Display help for all targets
jenkins/run-job-with-tag Run a Jenkins Job with $(TAG)
make/lint Lint all makefiles
packages/delete Delete packages
Expand Down
10 changes: 7 additions & 3 deletions modules/docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
.PHONY : docs
docs/deps::
@mkdir -p docs

.PHONY : docs/targets.md
## Update `docs/targets.md` from `make help`
docs/targets.md:
docs/targets.md: docs/deps
@( \
echo "## Makefile Targets"; \
echo '```'; \
$(SELF) --no-print-directory --quiet --silent help | sed $$'s,\x1b\\[[0-9;]*[a-zA-Z],,g'; \
$(SELF) --no-print-directory --quiet --silent $(DEFAULT_HELP_TARGET) | sed $$'s,\x1b\\[[0-9;]*[a-zA-Z],,g'; \
echo '```'; \
) > $@

.PHONY : docs/terraform.md
## Update `docs/terraform.md` from `terraform-docs`
docs/terraform.md: packages/install/terraform-docs
docs/terraform.md: docs/deps packages/install/terraform-docs
@terraform-docs md . > $@
1 change: 0 additions & 1 deletion modules/readme/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ readme/lint:

## Create README.md by building it from README.yaml
readme/build: $(README_DEPS)
@mkdir -p docs
@gomplate --file $(README_TEMPLATE_FILE) \
--out $(README_FILE) \
--datasource config=$(README_YAML) \
Expand Down
43 changes: 38 additions & 5 deletions templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@

{{ if has (ds "config") "description" }}
{{(ds "config").description }}
{{- end -}}
{{ end }}

---

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

{{ if eq (ds "config").license "APACHE2" }}
It's 100% Open Source and licensed under [APACHE2](LICENSE).
It's 100% Open Source and licensed under the [APACHE2](LICENSE).
{{ end }}
{{ if eq (ds "config").license "CC-BY-NC-SA-4.0" }}
It's 100% Open Source and licensed under the [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](LICENSE).

<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>
{{ end }}

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

{{- if has (ds "config") "quickstart" -}}
{{ if has (ds "config") "quickstart" -}}
## Quick Start

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

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

## Copyright

Copyright © 2017-{{ time.Now.Year }} [Cloud Posse, LLC](https://cloudposse.com)

{{ if eq (ds "config").license "APACHE2" }}
## License

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

Copyright © 2017-{{ time.Now.Year }} [Cloud Posse, LLC](https://cloudposse.com)

See [LICENSE](LICENSE) for full details.

Licensed to the Apache Software Foundation (ASF) under one
Expand All @@ -120,6 +129,30 @@ See [LICENSE](LICENSE) for full details.
specific language governing permissions and limitations
under the License.
{{ end }}
{{ if eq (ds "config").license "CC-BY-NC-SA-4.0" }}
## License

[![License](https://img.shields.io/badge/License-CC%20BY%20NC%20SA%204.0-blue.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/)

<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>

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/>).

**Attribution** You must attribute the work in the manner specified by the author or licensor.

**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.

**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.

## Distribution

Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder.

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.
{{ end }}
## Trademarks

All other trademarks referenced herein are the property of their respective owners.

## About

Expand Down

0 comments on commit 9d92815

Please sign in to comment.