From 52841fa1d9d034645571ce0a166f8313d1b988ba Mon Sep 17 00:00:00 2001 From: jolheiser Date: Mon, 20 Nov 2023 04:27:27 +0000 Subject: [PATCH] Makefile enhancements (#89) These are some things I changed to make local development easier, especially when having to update multiple versions of docs at once like the docusaurus v3 update. i.e. ```makefile GITEA_REMOTE := ~/code/code.gitea.io/gitea GITEA_LATEST_BRANCH := docs-v3 GITEA_VERSION_BRANCH_PREFIX := docs-v3- ... ``` to run the Makefile against my local repo. Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/89 Co-authored-by: jolheiser Co-committed-by: jolheiser --- Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index fa8563b4..ceafb51d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,11 @@ export NODE_OPTIONS := "--max-old-space-size=8192" +GITEA_REMOTE := https://github.com/go-gitea/gitea +GITEA_LATEST_BRANCH := main +GITEA_VERSION_BRANCH_PREFIX := release/v1. +GITEA_AWESOME_REMOTE := https://gitea.com/gitea/awesome-gitea.git +GITEA_AWESOME_BRANCH := main + .PHONY: all all: build @@ -9,11 +15,11 @@ create_dir: .PHONY: clone clone: create_dir - git clone https://github.com/go-gitea/gitea.git .tmp/upstream-docs || true + git clone $(GITEA_REMOTE) .tmp/upstream-docs || true .PHONY: clone_awesome clone_awesome: create_dir - git clone --branch=main https://gitea.com/gitea/awesome-gitea.git .tmp/upstream-awesome || true + git clone --branch=$(GITEA_AWESOME_BRANCH) $(GITEA_AWESOME_REMOTE) .tmp/upstream-awesome || true .PHONY: prepare-awesome-latest prepare-awesome-latest: clone_awesome @@ -25,7 +31,7 @@ prepare-awesome\#%: .PHONY: clone_main clone_main: clone - cd .tmp/upstream-docs && git clean -f && git reset --hard && git checkout main + cd .tmp/upstream-docs && git clean -f && git reset --hard && git checkout $(GITEA_LATEST_BRANCH) cur_path=`pwd` cd .tmp/upstream-docs/docs && bash scripts/trans-copy.sh cd $(cur_path) @@ -48,7 +54,7 @@ prepare-latest-zh-cn: .PHONY: clone_\#% clone_\#%: clone - cd .tmp/upstream-docs && git clean -f && git reset --hard && git checkout release/v1.$* + cd .tmp/upstream-docs && git clean -f && git reset --hard && git checkout $(GITEA_VERSION_BRANCH_PREFIX)$* cur_path=`pwd` cd .tmp/upstream-docs/docs && bash scripts/trans-copy.sh cd $(cur_path)