mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
topdir.mk: Make git-init-remote more robust (at least in theory)
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
5b38496ce1
commit
4a1c5b94df
1 changed files with 11 additions and 7 deletions
|
|
@ -11,6 +11,10 @@ SUBDIRS ?= $(wildcard inst/pre make scripts contrib src libs
|
|||
images htdocs tmpl doc test inst/post)
|
||||
endif
|
||||
|
||||
ifeq ($(USE_USER_URL),true)
|
||||
JANWARE_USER_PREFIX = $(JANWARE_USER)@
|
||||
endif
|
||||
|
||||
PROJECT_DESCR = $(TOPDIR)/make/project.conf
|
||||
GIT_DESCR = $(TOPDIR)/.git/description
|
||||
LIST_VCS_FILES = /bin/bash $(MOD_SCRIPT_DIR)/scm.sh ls-files
|
||||
|
|
@ -31,7 +35,7 @@ endif
|
|||
include $(MODDIR)/make/defs.mk
|
||||
|
||||
REMOTE_GIT_DIR = /srv/git/$(JANWARE_USER)/$(REMOTE_GIT_FLAVOUR)/$(PROJECT)
|
||||
REMOTE_GIT_URL = ssh://$(JANWARE_USER)@git.janware.com$(REMOTE_GIT_DIR)
|
||||
REMOTE_GIT_URL = ssh://$(JANWARE_USER_PREFIX)git.janware.com$(REMOTE_GIT_DIR)
|
||||
|
||||
include $(MODDIR)/make/dirs.mk
|
||||
|
||||
|
|
@ -132,15 +136,14 @@ git-init-from-cvs: git-init
|
|||
git commit -m "initial checkin of $(RPM_VERSION)"
|
||||
|
||||
git-config:
|
||||
git config --global user.name "$(FULL_NAME)"
|
||||
git config --global user.email $(JANWARE_USER)@janware.com
|
||||
git remote add origin $(REMOTE_GIT_URL)
|
||||
git remote set-url --push origin $(REMOTE_GIT_URL)
|
||||
git config --global user.name || git config --global user.name "$(FULL_NAME)"
|
||||
git config --global user.email || git config --global user.email $(JANWARE_USER)@janware.com
|
||||
git remote -v | grep -q '^origin' || git remote add origin $(REMOTE_GIT_URL)
|
||||
git remote -v | grep -q "^origin *$(REMOTE_GIT_URL)" || git remote set-url --push origin $(REMOTE_GIT_URL)
|
||||
|
||||
git-clone-to-remote:
|
||||
ssh git.janware.com "/opt/jw-build/bin/git-srv-admin.sh $(OPT_JANWARE_PROJECT) create-personal-project $(PROJECT)"
|
||||
git remote add origin $(REMOTE_GIT_URL)
|
||||
git remote set-url --push origin $(REMOTE_GIT_URL)
|
||||
make git-config
|
||||
git push --set-upstream origin master
|
||||
git push --all $(REMOTE_GIT_URL)
|
||||
make git-update-project-description
|
||||
|
|
@ -174,6 +177,7 @@ git-init.done:
|
|||
@if [ -e .git ]; then \
|
||||
echo $(TOPDIR)/.git already exists, not running git init ;\
|
||||
else \
|
||||
@echo git init ;\
|
||||
git init; \
|
||||
fi
|
||||
touch $@
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue