git.mk 686 Bytes
Newer Older
1
commit:
2
3
	git commit -a

4
tag:
5
6
	git tag ${VERSION}

7
git-push::
8
	git push --tags -u origin HEAD
9

10
git-pull:
11
12
	git pull --all

13
14
15
push-github: ## Push the code to github. You need to set up GITHUB_DEPLOY_KEY
ifeq ($(GITHUB_DEPLOY_KEY),)
else
16
	$(eval KEY_FILE := $(shell mktemp))
17
	@echo "$(GITHUB_DEPLOY_KEY)" > $(KEY_FILE)
18
19
20
21
22
	@git remote rm github-deploy || true
	git remote add github-deploy $(GITHUB_REPO)
	@GIT_SSH_COMMAND="ssh -i $(KEY_FILE)" git fetch github-deploy $(CI_COMMIT_REF_NAME) || true
	@GIT_SSH_COMMAND="ssh -i $(KEY_FILE)" git push github-deploy $(CI_COMMIT_REF_NAME)
	rm $(KEY_FILE)
23
endif
24

25
26
27
28
push:: git-push
pull:: git-pull

.PHONY:: commit tag push git-push git-pull push-github