Skip to content

Commit 169f31e

Browse files
committed
Add deps-docs command to makefile
Refactored `deps-docs` out of `docs` because `go-gitea#23629` broke Gitpod's docs setup (which grepped to get the hugo install command).
1 parent e52ea44 commit 169f31e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.gitpod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ tasks:
2424
make watch-frontend
2525
openMode: split-right
2626
- name: Run docs
27-
before: sudo bash -c "$(grep 'https://github.com/gohugoio/hugo/releases/download' Makefile | tr -d '\')" # install hugo
27+
before: sudo make deps-docs
2828
command: cd docs && make clean update && hugo server -D -F --baseUrl $(gp url 1313) --liveReloadPort=443 --appendPort=false --bind=0.0.0.0
2929
openMode: split-right
3030

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ help:
189189
@echo " - clean delete backend and integration files"
190190
@echo " - clean-all delete backend, frontend and integration files"
191191
@echo " - deps install dependencies"
192+
@echo " - deps-docs install docs dependencies"
192193
@echo " - deps-frontend install frontend dependencies"
193194
@echo " - deps-backend install backend dependencies"
194195
@echo " - deps-tools install tool dependencies"
@@ -816,11 +817,14 @@ release-docs: | $(DIST_DIRS) docs
816817
tar -czf $(DIST)/release/gitea-docs-$(VERSION).tar.gz -C ./docs/public .
817818

818819
.PHONY: docs
819-
docs:
820+
docs: deps-docs
821+
cd docs; make trans-copy clean build-offline;
822+
823+
.PHONY: deps-docs # TODO: find a way to install hugo without needing sudo permissions and add deps-docs to deps (the next block)
824+
deps-docs:
820825
@hash hugo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
821826
curl -sL https://github.com/gohugoio/hugo/releases/download/v$(HUGO_VERSION)/hugo_$(HUGO_VERSION)_Linux-64bit.tar.gz | tar zxf - -C /tmp && mv /tmp/hugo /usr/bin/hugo && chmod +x /usr/bin/hugo; \
822827
fi
823-
cd docs; make trans-copy clean build-offline;
824828

825829
.PHONY: deps
826830
deps: deps-frontend deps-backend deps-tools

0 commit comments

Comments
 (0)