From af737f6704238eb8cef42011b8d4f82908953855 Mon Sep 17 00:00:00 2001 From: Erik Moeller Date: Wed, 23 Sep 2020 17:49:00 -0700 Subject: [PATCH] Add support for docs repo to update-user-guides target The script is run inside a container that does not have access to the repo checkout, so moved the copy logic into the Makefile. Renamed script to accurately reflect its revised purpose. --- Makefile | 12 ++++++++---- ...{update-user-guides => generate-docs-screenshots} | 1 - 2 files changed, 8 insertions(+), 5 deletions(-) rename securedrop/bin/{update-user-guides => generate-docs-screenshots} (78%) diff --git a/Makefile b/Makefile index 7d343f897b8..fc62269c916 100644 --- a/Makefile +++ b/Makefile @@ -290,11 +290,15 @@ list-translators: ## Collect the names of translators since the last merge from list-all-translators: ## Collect the names of all translators in the project's history. @$(DEVSHELL) $(SDROOT)/securedrop/i18n_tool.py list-translators --all -# TODO: test this to make sure the paths in update-user-guides work .PHONY: update-user-guides -update-user-guides: ## Run the page layout tests to regenerate screenshots. - @echo "Running page layout tests to update guide screenshots..." - @$(DEVSHELL) $(SDBIN)/update-user-guides +update-user-guides: ## Regenerate docs screenshots. Set DOCS_REPO_DIR to repo checkout root. +ifndef DOCS_REPO_DIR + $(error DOCS_REPO_DIR must be set to the documentation repo checkout root.) +endif + @echo "Running page layout tests to update screenshots used in user guide..." + @$(DEVSHELL) $(SDBIN)/generate-docs-screenshots + @echo "Copying screenshots..." + cp securedrop/tests/pageslayout/screenshots/en_US/*.png $${DOCS_REPO_DIR}/docs/images/manual/screenshots @echo diff --git a/securedrop/bin/update-user-guides b/securedrop/bin/generate-docs-screenshots similarity index 78% rename from securedrop/bin/update-user-guides rename to securedrop/bin/generate-docs-screenshots index 637abcaf7a2..f017a0eea00 100755 --- a/securedrop/bin/update-user-guides +++ b/securedrop/bin/generate-docs-screenshots @@ -15,4 +15,3 @@ maybe_create_config_py ./i18n_tool.py translate-messages --compile pytest -v --page-layout "${@:-tests/pageslayout}" -cp tests/pageslayout/screenshots/en_US/*.png ../docs/images/manual/screenshots