Phuedx has uploaded a new change for review. https://gerrit.wikimedia.org/r/294838
Change subject: Update cachedpage.sh script ...................................................................... Update cachedpage.sh script Changes: * Add missing documentation * Remove the MEDIAWIKI_URL environment variable in favour of MEDIAWIKI_HOST, which is used to derive the page and asset URLs * Fix the asset URL, which used to 404 when MEDIAWIKI_URL was set to URLs like http://en.wiki.local.wmftest.net:8080/wiki/ Change-Id: I1d4ab0f2a49456f7bfbf5f9115d78e52d2cdd181 --- M dev-scripts/cachedpage.sh 1 file changed, 20 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/38/294838/1 diff --git a/dev-scripts/cachedpage.sh b/dev-scripts/cachedpage.sh index 5187335..a5f0950 100755 --- a/dev-scripts/cachedpage.sh +++ b/dev-scripts/cachedpage.sh @@ -1,6 +1,16 @@ #!/usr/bin/env bash -#usage ./dev-scripts/cachedpage.sh 1bd5bc53ebb04fff7f508712a29fdf1f1d7fe14f San_Francisco +# cachedpage.sh +# +# Usage: cachedpage.sh <rev> [title] +# +# Parameters: +# rev The revision of the Git commit that you want to check out in order to test the new assets +# against. See https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection for a detailed +# explanation of Git revision selection +# +# Options: +# title The title of the page that you're testing [default: Main_Page] if ! git diff --exit-code --quiet # check for unstaged changes @@ -19,14 +29,16 @@ git checkout $1 #go to commit caller requested +HOST=${MEDIAWIKI_HOST:-"http://127.0.0.1:8080"} + +TITLE=${2:-"Main_Page"} + #Generate the 'cached' pages mkdir -p tmp -URL=${MEDIAWIKI_URL:-"http://127.0.0.1:8080/w/index.php/"} -TITLE=${2:="Main_Page"} -echo "Using $URL as a development environment host." -echo "To specify a different host set MEDIAWIKI_URL environment variable" -echo '(e.g. by running "export MEDIAWIKI_URL=http://127.0.0.1:80/w/index.php")' -wget "$URL$TITLE?useformat=mobile" -O tmp/cached.html +echo "Using ${HOST} as a development environment host." +echo "To specify a different host set MEDIAWIKI_HOST environment variable" +echo '(e.g. by running "export MEDIAWIKI_HOST=http://127.0.0.1:80/")' +wget "${HOST}/wiki/${TITLE}?useformat=mobile" -O tmp/cached.html #Return to previous branch git checkout $cur_branch @@ -35,7 +47,7 @@ echo echo Cached page generated at following locations echo -echo \* $URL/extensions/MobileFrontend/tmp/cached.html +echo \* ${HOST}/w/extensions/MobileFrontend/tmp/cached.html if [ $stashed_changes ] then -- To view, visit https://gerrit.wikimedia.org/r/294838 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1d4ab0f2a49456f7bfbf5f9115d78e52d2cdd181 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Phuedx <g...@samsmith.io> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits