Skip to content

Commit 0278f51

Browse files
committed
Start uploading search index
1 parent 6062a3d commit 0278f51

File tree

2 files changed

+34
-6
lines changed

2 files changed

+34
-6
lines changed

conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def has(self, *args):
7070
'issue': ('https://jira.mongodb.org/browse/%s', '' ),
7171
'api': ('https://api.mongodb.com/%s', ''),
7272
'gettingstarted': ('https://docs.mongodb.com/getting-started%s', ''),
73-
'manual': ('https://docs.mongodb.org/manual%s', ''),
73+
'manual': ('https://docs.mongodb.com/manual%s', ''),
7474
'ecosystem': ('https://docs.mongodb.com/ecosystem%s', ''),
7575
'mms-docs': ('https://docs.cloud.mongodb.com%s', ''),
7676
'mms-home': ('https://cloud.mongodb.com%s', ''),

makefile

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,34 @@
1-
%:
2-
giza make $@
3-
help:
4-
@echo "Use 'make <target>', where <target> is a Sphinx target (e.g. 'html', 'latex')"
5-
@echo "See 'http://docs.mongodb.org/manual/meta' for more information."
1+
GIT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
2+
PRODUCTION_URL="https://docs.mongodb.com"
3+
PRODUCTION_BUCKET=docs-mongodb-org-prod
64

5+
.PHONY: help html deploy deploy-search-index
6+
7+
help: ## Show this help message
8+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
9+
@echo
10+
@echo 'Variables'
11+
@printf " \033[36m%-18s\033[0m %s\n" 'ARGS' 'Arguments to pass to mut-publish'
12+
13+
html: ## Builds this branch's HTML under build/<branch>/html
14+
giza make html
15+
16+
publish: ## Builds this branch's publishable HTML and other artifacts under build/public
17+
giza make publish
18+
19+
# The recursive behavior would CHANGE if --all-subdirectories were
20+
# given: ALL contents of build/public/<branch> would be upload
21+
deploy: build/public ## Deploy to the production bucket
22+
@echo "Doing a dry-run"
23+
mut-publish build/public ${PRODUCTION_BUCKET} --prefix=${PROJECT} --deploy --redirect-prefix='v[0-9]\.[0-9]' --redirect-prefix='manual' --redirect-prefix='master' --verbose --dry-run ${ARGS}
24+
25+
@echo 'Press any key to perform the previous' && read result
26+
mut-publish build/public ${PRODUCTION_BUCKET} --prefix=${PROJECT} --deploy --redirect-prefix='v[0-9]\.[0-9]' --redirect-prefix='manual' --redirect-prefix='master' ${ARGS}
27+
28+
@echo "Hosted at ${PRODUCTION_URL}/index.html"
29+
30+
$(MAKE) deploy-search-index
31+
32+
deploy-search-index: ## Update the search index for this branch
33+
@echo "Building search index"
34+
mut-index upload build/public/${GIT_BRANCH} -o manual-${GIT_BRANCH}.json -u ${PRODUCTION_URL}/${GIT_BRANCH} -s --exclude build/public/${GIT_BRANCH}/meta

0 commit comments

Comments
 (0)