Begin work migrating to native hex publishing

Use hex for credentials_obfuscation dep
This commit is contained in:
Luke Bakken 2022-04-15 10:24:39 -07:00
parent 8542bdfb93
commit fb5068a80e
No known key found for this signature in database
GPG Key ID: D99DE30E43EAE440
7 changed files with 63 additions and 44 deletions

1
.gitignore vendored
View File

@ -58,6 +58,7 @@
/sbin/ /sbin/
/sbin.lock /sbin.lock
erl_crash.dump erl_crash.dump
rebar3.crashdump
.envrc .envrc
*.plt *.plt
*.lock *.lock

View File

@ -15,6 +15,16 @@ define PROJECT_APP_EXTRA_KEYS
]} ]}
endef endef
define HEX_TARBALL_EXTRA_METADATA
#{
licenses => [<<"MPL-2.0">>],
links => #{
<<"Website">> => <<"https://www.rabbitmq.com">>,
<<"GitHub">> => <<"https://github.com/rabbitmq/rabbitmq-server/deps/amqp10_client">>
}
}
endef
# Release artifacts are put in $(PACKAGES_DIR). # Release artifacts are put in $(PACKAGES_DIR).
PACKAGES_DIR ?= $(abspath PACKAGES) PACKAGES_DIR ?= $(abspath PACKAGES)
@ -35,15 +45,11 @@ DEP_PLUGINS = rabbit_common/mk/rabbitmq-macros.mk \
DEP_PLUGINS += elvis_mk DEP_PLUGINS += elvis_mk
dep_elvis_mk = git https://github.com/inaka/elvis.mk.git master dep_elvis_mk = git https://github.com/inaka/elvis.mk.git master
# FIXME: Use erlang.mk patched for RabbitMQ, while waiting for PRs to be
# reviewed and merged.
ERLANG_MK_REPO = https://github.com/rabbitmq/erlang.mk.git
ERLANG_MK_COMMIT = rabbitmq-tmp
include ../../rabbitmq-components.mk include ../../rabbitmq-components.mk
include ../../erlang.mk include ../../erlang.mk
HEX_TARBALL_FILES += $(DEPS_DIR)/../rabbitmq-components.mk
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# Compiler flags. # Compiler flags.
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -10,20 +10,25 @@ define PROJECT_APP_EXTRA_KEYS
]}, ]},
{build_tools, ["make", "rebar3"]}, {build_tools, ["make", "rebar3"]},
{files, [ {files, [
$(RABBITMQ_HEXPM_DEFAULT_FILES), $(RABBITMQ_HEXPM_DEFAULT_FILES)
"mk"
]} ]}
endef endef
define HEX_TARBALL_EXTRA_METADATA
#{
licenses => [<<"MPL-2.0">>],
links => #{
<<"Website">> => <<"https://www.rabbitmq.com">>,
<<"GitHub">> => <<"https://github.com/rabbitmq/rabbitmq-server/deps/amqp10_common">>
}
}
endef
HEX_TARBALL_FILES += $(DEPS_DIR)/../rabbitmq-components.mk
DIALYZER_OPTS += --src -r test DIALYZER_OPTS += --src -r test
BUILD_DEPS = rabbit_common BUILD_DEPS = rabbit_common
# FIXME: Use erlang.mk patched for RabbitMQ, while waiting for PRs to be
# reviewed and merged.
ERLANG_MK_REPO = https://github.com/rabbitmq/erlang.mk.git
ERLANG_MK_COMMIT = rabbitmq-tmp
# Variables and recipes in development.*.mk are meant to be used from # Variables and recipes in development.*.mk are meant to be used from
# any Git clone. They are excluded from the files published to Hex.pm. # any Git clone. They are excluded from the files published to Hex.pm.
# Generated files are published to Hex.pm however so people using this # Generated files are published to Hex.pm however so people using this

View File

@ -8,7 +8,7 @@ define PROJECT_ENV
{prefer_ipv6, false}, {prefer_ipv6, false},
{ssl_options, []}, {ssl_options, []},
{writer_gc_threshold, 1000000000} {writer_gc_threshold, 1000000000}
] ]
endef endef
define PROJECT_APP_EXTRA_KEYS define PROJECT_APP_EXTRA_KEYS
@ -25,6 +25,17 @@ define PROJECT_APP_EXTRA_KEYS
]} ]}
endef endef
define HEX_TARBALL_EXTRA_METADATA
#{
licenses => [<<"MPL-2.0">>],
links => #{
<<"Website">> => <<"https://www.rabbitmq.com">>,
<<"GitHub">> => <<"https://github.com/rabbitmq/rabbitmq-server/deps/amqp_client">>,
<<"User guide">> => <<"https://www.rabbitmq.com/erlang-client-user-guide.html">>
}
}
endef
# Release artifacts are put in $(PACKAGES_DIR). # Release artifacts are put in $(PACKAGES_DIR).
PACKAGES_DIR ?= $(abspath PACKAGES) PACKAGES_DIR ?= $(abspath PACKAGES)
@ -42,13 +53,9 @@ DEP_PLUGINS = rabbit_common/mk/rabbitmq-build.mk \
PLT_APPS = ssl public_key PLT_APPS = ssl public_key
# FIXME: Use erlang.mk patched for RabbitMQ, while waiting for PRs to be
# reviewed and merged.
ERLANG_MK_REPO = https://github.com/rabbitmq/erlang.mk.git
ERLANG_MK_COMMIT = rabbitmq-tmp
WITHOUT = plugins/proper WITHOUT = plugins/proper
include ../../rabbitmq-components.mk include ../../rabbitmq-components.mk
include ../../erlang.mk include ../../erlang.mk
HEX_TARBALL_FILES += $(DEPS_DIR)/../rabbitmq-components.mk

View File

@ -6,7 +6,7 @@ define PROJECT_APP_EXTRA_KEYS
{licenses, ["MPL-2.0"]}, {licenses, ["MPL-2.0"]},
{links, [ {links, [
{"Website", "https://www.rabbitmq.com/"}, {"Website", "https://www.rabbitmq.com/"},
{"GitHub", "https://github.com/rabbitmq/rabbitmq-common"} {"GitHub", "https://github.com/rabbitmq/rabbitmq-server/deps/rabbit_common"}
]}, ]},
{build_tools, ["make", "rebar3"]}, {build_tools, ["make", "rebar3"]},
{files, [ {files, [
@ -15,16 +15,20 @@ define PROJECT_APP_EXTRA_KEYS
]} ]}
endef endef
define HEX_TARBALL_EXTRA_METADATA
#{
licenses => [<<"MPL-2.0">>],
links => #{
<<"Website">> => <<"https://www.rabbitmq.com">>,
<<"GitHub">> => <<"https://github.com/rabbitmq/rabbitmq-server/deps/rabbit_common">>
}
}
endef
LOCAL_DEPS = compiler crypto public_key sasl ssl syntax_tools tools xmerl LOCAL_DEPS = compiler crypto public_key sasl ssl syntax_tools tools xmerl
DEPS = jsx recon credentials_obfuscation DEPS = jsx recon credentials_obfuscation
dep_credentials_obfuscation = git https://github.com/rabbitmq/credentials-obfuscation.git master dep_credentials_obfuscation = hex 2.4.0
# FIXME: Use erlang.mk patched for RabbitMQ, while waiting for PRs to be
# reviewed and merged.
ERLANG_MK_REPO = https://github.com/rabbitmq/erlang.mk.git
ERLANG_MK_COMMIT = rabbitmq-tmp
# Variables and recipes in development.*.mk are meant to be used from # Variables and recipes in development.*.mk are meant to be used from
# any Git clone. They are excluded from the files published to Hex.pm. # any Git clone. They are excluded from the files published to Hex.pm.
@ -50,4 +54,6 @@ PLT_APPS += mnesia crypto ssl
include ../../rabbitmq-components.mk include ../../rabbitmq-components.mk
include ../../erlang.mk include ../../erlang.mk
HEX_TARBALL_FILES += $(DEPS_DIR)/../rabbitmq-components.mk
-include development.post.mk -include development.post.mk

View File

@ -30,6 +30,8 @@ endif
# RabbitMQ components. # RabbitMQ components.
# -------------------------------------------------------------------- # --------------------------------------------------------------------
dep_amqp10_client = hex $(PROJECT_VERSION)
dep_amqp10_common = hex $(PROJECT_VERSION)
dep_amqp_client = hex $(PROJECT_VERSION) dep_amqp_client = hex $(PROJECT_VERSION)
dep_rabbit_common = hex $(PROJECT_VERSION) dep_rabbit_common = hex $(PROJECT_VERSION)

View File

@ -4,14 +4,6 @@
.PHONY: hex-publish hex-publish-docs .PHONY: hex-publish hex-publish-docs
HEXPM_URL = https://github.com/rabbitmq/hexpm-cli/releases/latest/download/hexpm
HEXPM_CLI = $(ERLANG_MK_TMP)/hexpm
$(HEXPM_CLI):
$(verbose) mkdir -p $(ERLANG_MK_TMP)
$(gen_verbose) $(call core_http_get,$@,$(HEXPM_URL))
$(verbose) chmod +x $@
RABBIT_COMMON_HEXPM_VERSION = $(PROJECT_VERSION) RABBIT_COMMON_HEXPM_VERSION = $(PROJECT_VERSION)
AMQP10_COMMON_HEXPM_VERSION = $(PROJECT_VERSION) AMQP10_COMMON_HEXPM_VERSION = $(PROJECT_VERSION)
AMQP10_CLIENT_HEXPM_VERSION = $(PROJECT_VERSION) AMQP10_CLIENT_HEXPM_VERSION = $(PROJECT_VERSION)
@ -37,7 +29,7 @@ endef
RMQ_COMPONENTS_PLAIN = $(DEPS_DIR)/../rabbitmq-components.mk RMQ_COMPONENTS_PLAIN = $(DEPS_DIR)/../rabbitmq-components.mk
RMQ_COMPONENTS_HEXPM = $(DEPS_DIR)/rabbit_common/mk/rabbitmq-components.hexpm.mk RMQ_COMPONENTS_HEXPM = $(DEPS_DIR)/rabbit_common/mk/rabbitmq-components.hexpm.mk
hex-publish: $(HEXPM_CLI) app rebar.config hex-publish: app rebar.config
$(gen_verbose) echo "$(PROJECT_DESCRIPTION) $(PROJECT_VERSION)" \ $(gen_verbose) echo "$(PROJECT_DESCRIPTION) $(PROJECT_VERSION)" \
> git-revisions.txt > git-revisions.txt
$(verbose) mv \ $(verbose) mv \
@ -59,8 +51,8 @@ hex-publish: $(HEXPM_CLI) app rebar.config
rabbitmq-components.mk.not-hexpm \ rabbitmq-components.mk.not-hexpm \
$(RMQ_COMPONENTS_PLAIN); \ $(RMQ_COMPONENTS_PLAIN); \
fi' EXIT INT; \ fi' EXIT INT; \
$(HEXPM_CLI) publish $(MAKE) hex-release-publish
hex-publish-docs: $(HEXPM_CLI) app docs hex-publish-docs: app docs
$(gen_verbose) trap 'rm -f rebar.lock' EXIT INT; \ $(gen_verbose) trap 'rm -f rebar.lock' EXIT INT; \
$(HEXPM_CLI) docs $(MAKE) hex-docs-publish