aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-11-12 21:35:05 +0100
committerLoïc Hoguin <[email protected]>2017-11-12 21:35:05 +0100
commit26827acbae6e01f93d2261cdea915ee0d8a650f2 (patch)
treeceb63b996f1c373381b6d9200e62ed337ba245e6
downloadci.erlang.mk-26827acbae6e01f93d2261cdea915ee0d8a650f2.tar.gz
ci.erlang.mk-26827acbae6e01f93d2261cdea915ee0d8a650f2.tar.bz2
ci.erlang.mk-26827acbae6e01f93d2261cdea915ee0d8a650f2.zip
Initial commit
-rw-r--r--LICENSE13
-rw-r--r--README.asciidoc25
-rw-r--r--early-plugins.mk61
3 files changed, 99 insertions, 0 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..74640d6
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,13 @@
+Copyright (c) 2017, Loïc Hoguin <[email protected]>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/README.asciidoc b/README.asciidoc
new file mode 100644
index 0000000..32d727b
--- /dev/null
+++ b/README.asciidoc
@@ -0,0 +1,25 @@
+= ci.erlang.mk
+
+An https://erlang.mk/[Erlang.mk] plugin that maintains a list
+of Erlang/OTP versions in their most recent patch version. It
+allows configuring a project as supporting `OTP-19+`, for example,
+and automatically fills in the `CI_OTP` or other relevant variables
+with the most up to date list of versions. It also provides a target
+for automatically deleting older patch releases.
+
+[source,make]
+----
+BUILD_DEPS = ci.erlang.mk
+dep_ci.erlang.mk = git https://github.com/ninenines/ci.erlang.mk master
+DEP_EARLY_PLUGINS = ci.erlang.mk
+
+AUTO_CI_OTP ?= OTP-19+
+AUTO_CI_HIPE ?= OTP-LATEST
+# AUTO_CI_ERLLVM ?= OTP-LATEST
+
+include erlang.mk
+----
+
+Please consult 'early-plugins.mk' for a detailed list of
+the allowed values. You may also define your own values
+by creating the corresponding variable.
diff --git a/early-plugins.mk b/early-plugins.mk
new file mode 100644
index 0000000..477ea28
--- /dev/null
+++ b/early-plugins.mk
@@ -0,0 +1,61 @@
+# Copyright (c) 2017, Loïc Hoguin <[email protected]>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+# We do not keep track of anything below patch releases.
+# They are meant for OTP customers, are not announced
+# and do not come with an easy to read changelog. They
+# are also unlikely to be used by anyone other than
+# OTP customers.
+
+OTP-18 := OTP-18.0.3 OTP-18.1.5 OTP-18.2.4 OTP-18.3.4
+OTP-19 := OTP-19.0.7 OTP-19.1.6 OTP-19.2.3 OTP-19.3.6
+OTP-20 := OTP-20.0.5 OTP-20.1.5
+
+OTP-18+ := $(OTP-18) $(OTP-19) $(OTP-20)
+OTP-19+ := $(OTP-19) $(OTP-20)
+OTP-20+ := $(OTP-20)
+
+OTP-LATEST := $(lastword $(OTP-18+))
+
+# Older OTP versions that this plugin previously supported
+# are listed here. This list is used to cleanup builds and
+# installations that we do not care about anymore.
+
+OTP-DROPPED :=
+
+# Configure Erlang.mk's CI plugin.
+
+CI_OTP := $(foreach otp,$(AUTO_CI_OTP),$($(otp)))
+CI_HIPE := $(foreach otp,$(AUTO_CI_HIPE),$($(otp)))
+CI_ERLLVM := $(foreach otp,$(AUTO_CI_ERLLVM),$($(otp)))
+
+# Cleanup older OTP versions we don't care about anymore.
+
+CI_AUTO_CLEANUP_TARGETS := $(foreach t,$(OTP-DROPPED),ci-auto-cleanup-$t)
+
+.PHONY: ci-auto-cleanup $(CI_AUTO_CLEANUP_TARGETS)
+
+define ci_auto_cleanup_target
+ci-auto-cleanup-$1: $$(KERL)
+ $$(verbose) $$(KERL) list builds | grep -q "^git,$1$$$$" && $$(KERL) delete build $1 || true
+ $$(verbose) $$(KERL) list installations | grep -q "^$1 " && $$(KERL) delete installation $1 || true
+ $$(verbose) $$(KERL) list builds | grep -q "^git,$1-native$$$$" && $$(KERL) delete build $1-native || true
+ $$(verbose) $$(KERL) list installations | grep -q "^$1-native " && $$(KERL) delete installation $1-native || true
+ $$(verbose) $$(KERL) list builds | grep -q "^git,$1-erllvm$$$$" && $$(KERL) delete build $1-erllvm || true
+ $$(verbose) $$(KERL) list installations | grep -q "^$1-erllvm " && $$(KERL) delete installation $1-erllvm || true
+endef
+
+$(foreach t,$(OTP-DROPPED),$(eval $(call ci_auto_cleanup_target,$t)))
+
+ci-auto-cleanup: $(CI_AUTO_CLEANUP_TARGETS)