@@ -93,34 +93,19 @@ while [[ $# -gt 0 ]]; do
9393 esac
9494done
9595
96- # --- DEBUG CONFIG ---
9796echo " ========================================"
98- echo " bd BUILD ENVIRONMENT DEBUG "
97+ echo " BUILD CONFIGURATION "
9998echo " ========================================"
100- echo " bd CLEAN=$CLEAN "
101- echo " bd BUILD_QUALIFIER='$BUILD_QUALIFIER '"
102- echo " bd QUALIFIER_FLAG: ${QUALIFIER_FLAG[*]:- } "
103- echo " bd OTHER_FLAGS: ${OTHER_FLAGS[*]:- } "
104- echo " bd EXTRA_ARGS: ${EXTRA_ARGS[*]:- } "
105- echo " bd BRANCH_ZITI_DOC='$BRANCH_ZITI_DOC '"
106- echo " bd BRANCH_ZROK='$BRANCH_ZROK '"
107- echo " bd BRANCH_FRONTDOOR='$BRANCH_FRONTDOOR '"
108- echo " bd BRANCH_SELFHOSTED='$BRANCH_SELFHOSTED '"
109- echo " bd BRANCH_ZLAN='$BRANCH_ZLAN '"
110- echo " bd BRANCH_PLATFORM='$BRANCH_PLATFORM '"
111- echo " ----------------------------------------"
112- echo " bd ENV VARS:"
113- echo " bd IS_VERCEL='${IS_VERCEL:- } '"
114- echo " bd VERCEL='${VERCEL:- } '"
115- echo " bd VERCEL_ENV='${VERCEL_ENV:- } '"
116- echo " bd CI='${CI:- } '"
117- echo " bd NODE_ENV='${NODE_ENV:- } '"
118- echo " bd PWD='$( pwd) '"
119- echo " ----------------------------------------"
120- echo " bd VERSIONS:"
121- echo " bd node: $( node --version 2> /dev/null || echo ' not found' ) "
122- echo " bd yarn: $( yarn --version 2> /dev/null || echo ' not found' ) "
123- echo " bd npm: $( npm --version 2> /dev/null || echo ' not found' ) "
99+ echo " BRANCH_ZITI_DOC='$BRANCH_ZITI_DOC '"
100+ echo " BRANCH_ZROK='$BRANCH_ZROK '"
101+ echo " BRANCH_FRONTDOOR='$BRANCH_FRONTDOOR '"
102+ echo " BRANCH_SELFHOSTED='$BRANCH_SELFHOSTED '"
103+ echo " BRANCH_ZLAN='$BRANCH_ZLAN '"
104+ echo " BRANCH_PLATFORM='$BRANCH_PLATFORM '"
105+ echo " CLEAN=$CLEAN "
106+ echo " IS_VERCEL='${IS_VERCEL:- } '"
107+ echo " node: $( node --version 2> /dev/null || echo ' not found' ) "
108+ echo " yarn: $( yarn --version 2> /dev/null || echo ' not found' ) "
124109echo " ========================================"
125110
126111script_dir=" $( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " && pwd) "
@@ -133,7 +118,6 @@ clone_or_update() {
133118 local url=" $1 " dest=" $2 " branch=" ${3:- main} "
134119 local target=" $script_dir /_remotes/$dest "
135120
136- echo " bd clone_or_update url='$url ' dest='$dest ' branch='$branch ' target='$target ' CLEAN='${CLEAN:- 0} '"
137121
138122 # --- AUTHENTICATION LOGIC ---
139123 case " $url " in
@@ -187,10 +171,8 @@ clone_or_update() {
187171 ;;
188172 esac
189173
190- echo " bd clone_or_update effective_url='${url//:*@/:// [REDACTED]@ } '"
191-
192174 if [ -d " $target /.git" ]; then
193- echo " bd existing repo detected; fetching branch '$branch '"
175+ echo " Updating ' $dest ' @ '$branch '... "
194176 git -C " $target " remote set-url origin " $url " 2>&1 || git -C " $target " remote add origin " $url " 2>&1 || true
195177 if ! git -C " $target " fetch --depth 1 origin " $branch " 2>&1 \
196178 || ! git -C " $target " reset --hard FETCH_HEAD 2>&1 ; then
@@ -199,19 +181,17 @@ clone_or_update() {
199181 git ls-remote --heads " $url " | awk ' {print $2}' | sed ' s|refs/heads/||'
200182 exit 1
201183 fi
202- echo " bd fetch+reset succeeded"
203184 elif [ -d " $target " ]; then
204185 echo " ❌ ${target} exists but is not a git repo."
205186 ls -la " $target " 2>&1 || true
206187 exit 1
207188 else
208- echo " bd cloning branch ' $branch ' -> '$target ' "
189+ echo " Cloning ' $dest ' @ '$branch '... "
209190 if ! git clone --single-branch --branch " $branch " --depth 1 " $url " " $target " 2>&1 ; then
210191 echo " ❌ Clone failed. Available branches in ${url//:*@/:// [REDACTED]@ } :"
211192 git ls-remote --heads " $url " | awk ' {print $2}' | sed ' s|refs/heads/||'
212193 exit 1
213194 fi
214- echo " bd clone succeeded"
215195 fi
216196}
217197
@@ -345,12 +325,8 @@ lint_docs() {
345325# =============================================================================
346326# MAIN EXECUTION
347327# =============================================================================
348- echo " bd DEBUG: scanning for git dirs under _remotes"
349- find " $script_dir /_remotes" -name .git -type d 2>&1 || true
350-
351-
352328if [ " ${CLEAN:- 0} " -eq 1 ]; then
353- echo " bd CLEAN=1 removing contents of _remotes (preserving package.json)"
329+ echo " CLEAN: removing _remotes contents (preserving package.json)"
354330 find " $script_dir /_remotes" -mindepth 1 -maxdepth 1 ! -name ' package.json' -exec rm -rf {} +
355331fi
356332
@@ -361,17 +337,8 @@ clone_or_update "https://github.com/netfoundry/zlan.git"
361337clone_or_update " https://github.com/openziti/zrok.git" zrok " $BRANCH_ZROK "
362338clone_or_update " https://bitbucket.org/netfoundry/platform-doc.git" platform " $BRANCH_PLATFORM "
363339
364- echo " ========================================"
365- echo " bd POST-CLONE DEBUG"
366- echo " ========================================"
367- echo " bd Directories in _remotes:"
368- ls -la " $script_dir /_remotes" 2> /dev/null || echo " (none)"
369- echo " ----------------------------------------"
370- echo " bd Looking for docusaurus build/ and .docusaurus/ dirs in remotes:"
371- find " $script_dir /_remotes" -type d \( -path " */docusaurus/build" -o -path " */docusaurus/.docusaurus" -o -path " */website/build" -o -path " */website/.docusaurus" \) 2> /dev/null || echo " (none found)"
372- echo " bd Cleaning stale build artifacts from remotes..."
340+ echo " Cleaning stale build artifacts from remotes..."
373341find " $script_dir /_remotes" -type d \( -path " */docusaurus/build" -o -path " */docusaurus/.docusaurus" -o -path " */website/build" -o -path " */website/.docusaurus" \) -exec rm -rf {} + 2> /dev/null || true
374- echo " ========================================"
375342
376343echo " copying versionable docs locally..."
377344" ${script_dir} /sync-versioned-remote.sh" zrok
@@ -397,30 +364,26 @@ pushd "${script_dir}" >/dev/null
397364yarn install
398365
399366if [ " ${CLEAN:- 0} " -eq 1 ]; then
400- echo " bd CLEAN=1: running yarn clear to remove .docusaurus cache"
367+ echo " CLEAN: clearing Docusaurus cache"
401368 yarn clear
402369fi
403370
404- echo " ========================================"
405- echo " bd PRE-BUILD DEBUG"
406- echo " ========================================"
407- echo " bd IS_VERCEL='${IS_VERCEL:- } '"
408- echo " bd VERCEL='${VERCEL:- } '"
409- echo " bd script_dir='${script_dir} '"
410- echo " bd BUILD_QUALIFIER='${BUILD_QUALIFIER} '"
411- echo " bd output dir: build${BUILD_QUALIFIER} "
412- echo " ========================================"
413-
414371now=$( date)
415372commit=$( git -C " ${script_dir} " rev-parse --short HEAD 2> /dev/null || echo " unknown" )
416373printf " %s\n%s\n" " $now " " $commit " > " ${script_dir} /static/build-time.txt"
417- echo " BUILDING docs into: build${BUILD_QUALIFIER} at $now "
418374
419375MINIFY_FLAG=" "
420376if [ -n " ${NO_MINIFY:- } " ]; then
421377 MINIFY_FLAG=" --no-minify"
422378fi
423- echo " NO_MINIFY flag: $MINIFY_FLAG "
379+
380+ echo " ========================================"
381+ echo " DOCUSAURUS BUILD"
382+ echo " ========================================"
383+ echo " Output dir: build${BUILD_QUALIFIER} "
384+ echo " Build mask: ${DOCUSAURUS_BUILD_MASK:- 0xFF} "
385+ echo " No-minify: ${NO_MINIFY:- false} "
386+ echo " ========================================"
424387
425388yarn build $MINIFY_FLAG --out-dir " build${BUILD_QUALIFIER} " 2>&1
426389popd > /dev/null
0 commit comments