1
0
mirror of https://github.com/gsi-upm/senpy synced 2024-11-25 01:22:28 +00:00
senpy/.makefiles/git.mk

29 lines
686 B
Makefile
Raw Normal View History

2017-09-29 13:11:08 +00:00
commit:
2017-09-27 19:08:21 +00:00
git commit -a
2017-09-29 13:11:08 +00:00
tag:
2017-09-27 19:08:21 +00:00
git tag ${VERSION}
2017-09-29 13:51:56 +00:00
git-push::
2017-09-29 13:39:26 +00:00
git push --tags -u origin HEAD
2017-09-27 19:08:21 +00:00
2017-09-29 13:51:56 +00:00
git-pull:
2017-09-29 13:11:08 +00:00
git pull --all
2017-09-29 13:51:56 +00:00
push-github: ## Push the code to github. You need to set up GITHUB_DEPLOY_KEY
ifeq ($(GITHUB_DEPLOY_KEY),)
else
2017-10-03 13:40:56 +00:00
$(eval KEY_FILE := "$(shell mktemp)")
2017-09-29 13:51:56 +00:00
@echo "$(GITHUB_DEPLOY_KEY)" > $(KEY_FILE)
2017-09-27 19:08:21 +00:00
@git remote rm github-deploy || true
git remote add github-deploy $(GITHUB_REPO)
2017-10-03 13:40:56 +00:00
-@GIT_SSH_COMMAND="ssh -i $(KEY_FILE)" git fetch github-deploy $(CI_COMMIT_REF_NAME)
@GIT_SSH_COMMAND="ssh -i $(KEY_FILE)" git push github-deploy HEAD:$(CI_COMMIT_REF_NAME)
2017-09-27 19:08:21 +00:00
rm $(KEY_FILE)
2017-09-29 13:51:56 +00:00
endif
2017-09-27 19:08:21 +00:00
2017-09-29 13:51:56 +00:00
push:: git-push
pull:: git-pull
.PHONY:: commit tag push git-push git-pull push-github