workspaces_registry_template/build_all_branches.sh

25 lines
744 B
Bash
Raw Normal View History

2023-01-13 16:59:58 +00:00
#!/bin/sh
DEFAULT=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')
mkdir base
2023-01-13 19:24:46 +00:00
cat > base/index.html << EOF
<meta http-equiv="refresh" content="0; url=./$DEFAULT/">
2023-01-13 16:59:58 +00:00
EOF
2023-01-13 19:24:46 +00:00
touch base/.nojekyll
2023-01-13 16:59:58 +00:00
# Generating documentation for each other branch in a subdirectory
2023-01-13 18:28:53 +00:00
for BRANCH in $(git branch --remotes --format '%(refname:lstrip=3)' | grep -Ev '^(HEAD|develop|gh-pages)$'); do
2023-01-13 16:59:58 +00:00
echo "$BRANCH" >> base/versions.txt
git checkout $BRANCH
node processing
cp -a public/. process
npm run deploy --prefix site
cp -a process/. public/ # Have to run it again because the deploy wipes the file and folders out
rm -rf process
mv public base/$BRANCH
2023-03-27 09:03:51 +00:00
cp base/$BRANCH/favicon.ico base/favicon.ico
2023-01-13 16:59:58 +00:00
done
mv base public