Clone once #52
Labels
No Label
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No Milestone
No Assignees
4 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gitea/gitea-docusaurus#52
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "jolheiser/gitea-docusaurus:clone-once"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #30
Closes #31
Closes #42
Rather than partially cloning, instead we clone once and then
clean
(to remove generated files),reset
(to reset changed files), andcheckout
branches as needed. This should allow the outdated translation check to continue to work while also reducing build times significantly.Before:
After:
Good Idea! I noticed a few things
@ -45,2 +48,3 @@
cp .tmp/upstream-docs/docs/content/index.zh-cn.md i18n/zh-cn/docusaurus-plugin-content-docs/current/intro.md
bash loop_docs.sh latest zh-cn
rm -rf .tmp/upstream-docs-latest
# rm -rf .tmp/upstream-docs-latest
Why not remove?
Removing would make it clone the next time, which would defeat the purpose of this PR. I can remove the line rather than comment, though.
It also means re-running the build commands doesn't require re-cloning, which makes local dev easier. The only caveat is that
make clean
is required in order to get "new" docs if there are commits to the upstream during dev. (or you couldcd
and manually pull it)I think @denyskon meant removing the commented-out code…
Oof, yeah that makes way more sense....
I can remove it! 😁
I ment removing the line 😆 It is good not to remove the directory in between.
@ -71,2 +74,3 @@
cp .tmp/upstream-docs/docs/content/index.zh-cn.md i18n/zh-cn/docusaurus-plugin-content-docs/version-1.$*/intro.md
bash loop_docs.sh $* zh-cn
rm -rf .tmp/upstream-docs-$*
#rm -rf .tmp/upstream-docs-$*
As above
@ -2,3 +2,2 @@
# The script takes two params:
# version: "latest" or a specific version number
# The script takes one param:
The script takes locale as a param and checks if ....
@ -9,1 +9,4 @@
.PHONY: clone
clone: create_dir
git clone https://github.com/go-gitea/gitea.git .tmp/upstream-docs || true
Why always successful?
If the clone already exists
git
complains that it already exists and the command fails, however for local dev it's very helpful if the clone already exists rather than re-cloning.The problem I see with that: There can be arbitrary many reasons why the clone fails.
I'm more in favor of explicitly handling this one edge case than never failing.
I want to know if the clone fails for any other reason.
You would still see if/why the clone fails, it prints all output still.
Could we just clone the special branches here?
@ -25,2 +28,3 @@
cd .tmp/upstream-docs && git clean -f && git reset --hard && git checkout main
cur_path=`pwd`
cd .tmp/upstream-docs-latest/docs && bash scripts/trans-copy.sh
cd .tmp/upstream-docs/docs && bash scripts/trans-copy.sh
How is that supposed to work?
You are never
cd
ing out?Each line in a recipe is ran in a separate sub-shell.
@ -45,2 +48,3 @@
cp .tmp/upstream-docs/docs/content/index.zh-cn.md i18n/zh-cn/docusaurus-plugin-content-docs/current/intro.md
bash loop_docs.sh latest zh-cn
rm -rf .tmp/upstream-docs-latest
# rm -rf .tmp/upstream-docs-latest
Commented out code?
@ -51,2 +54,3 @@
cd .tmp/upstream-docs && git clean -f && git reset --hard && git checkout release/v1.$*
cur_path=`pwd`
cd .tmp/upstream-docs-$*/docs && bash scripts/trans-copy.sh
cd .tmp/upstream-docs/docs && bash scripts/trans-copy.sh
Same as above?
@ -71,2 +74,3 @@
cp .tmp/upstream-docs/docs/content/index.zh-cn.md i18n/zh-cn/docusaurus-plugin-content-docs/version-1.$*/intro.md
bash loop_docs.sh $* zh-cn
rm -rf .tmp/upstream-docs-$*
#rm -rf .tmp/upstream-docs-$*
See above
Could we just clone the special branches but not all?
Possibly, but I'm not sure how much that will improve it since main will have the most refs anyways