diff options
author | Jean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr> | 2018-04-18 12:03:41 +0200 |
---|---|---|
committer | Jean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr> | 2018-04-18 12:04:57 +0200 |
commit | 8bbb04abc50513ff07a98ee858088268692a90ce (patch) | |
tree | 5b132f2a31f5dc330fd9c18409d5671f589d6651 | |
parent | cadf213fe6501e498a898ee59125b249959bb156 (diff) | |
download | rabbitmq-codegen-git-8bbb04abc50513ff07a98ee858088268692a90ce.tar.gz |
Makefile: New targets to print Git repoository URLsv3.7.9-rc.3v3.7.9-rc.2v3.7.9-rc.1v3.7.9v3.7.8-rc.4v3.7.8-rc.3v3.7.8-rc.2v3.7.8-rc.1v3.7.8v3.7.7-rc.2v3.7.7-rc.1v3.7.7-beta.2v3.7.7-beta.1v3.7.7v3.7.6-rc.2v3.7.6-rc.1v3.7.6v3.7.5-rc.1v3.7.5-beta.3v3.7.5v3.7.10-rc.4v3.7.10-rc.3v3.7.10-rc.2v3.7.10-rc.1v3.7.10
They are useful to query the upstream/default Git repository URLs for
both fetch and push.
They were copied from rabbitmq-common.
[#156874375]
(cherry picked from commit c6423237f13a712f94a0051b0c42aa572a714791)
-rw-r--r-- | Makefile | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -1,3 +1,5 @@ +.PHONY: all clean distclean + all: @: @@ -6,3 +8,35 @@ clean: distclean: clean find . -regex '.*\(~\|#\|\.swp\)' -exec rm {} \; + +# Upstream URL for the current project. +RABBITMQ_COMPONENT_REPO_NAME := rabbitmq-codegen +RABBITMQ_UPSTREAM_FETCH_URL ?= https://github.com/rabbitmq/$(RABBITMQ_COMPONENT_REPO_NAME).git +RABBITMQ_UPSTREAM_PUSH_URL ?= git@github.com:rabbitmq/$(RABBITMQ_COMPONENT_REPO_NAME).git + +# Current URL for the current project. If this is not a Git clone, +# default to the upstream Git repository. +ifneq ($(wildcard .git),) +git_origin_fetch_url := $(shell git config remote.origin.url) +git_origin_push_url := $(shell git config remote.origin.pushurl || git config remote.origin.url) +RABBITMQ_CURRENT_FETCH_URL ?= $(git_origin_fetch_url) +RABBITMQ_CURRENT_PUSH_URL ?= $(git_origin_push_url) +else +RABBITMQ_CURRENT_FETCH_URL ?= $(RABBITMQ_UPSTREAM_FETCH_URL) +RABBITMQ_CURRENT_PUSH_URL ?= $(RABBITMQ_UPSTREAM_PUSH_URL) +endif + +.PHONY: show-upstream-git-fetch-url show-upstream-git-push-url \ + show-current-git-fetch-url show-current-git-push-url + +show-upstream-git-fetch-url: + @echo $(RABBITMQ_UPSTREAM_FETCH_URL) + +show-upstream-git-push-url: + @echo $(RABBITMQ_UPSTREAM_PUSH_URL) + +show-current-git-fetch-url: + @echo $(RABBITMQ_CURRENT_FETCH_URL) + +show-current-git-push-url: + @echo $(RABBITMQ_CURRENT_PUSH_URL) |