Manual: Update build scripts in preparation of multi-repo setup

This commit is contained in:
octospacc 2023-02-28 10:34:48 +01:00
parent 8e53b8fd4d
commit 16e883db7d
5 changed files with 29 additions and 14 deletions

View File

@ -18,10 +18,11 @@ jobs:
- name: Build
run: |
sudo apt update
sudo apt install -y wget npm python3 python3-pip
sudo apt install -y git wget npm python3 python3-pip
sudo npm install -g tiddlywiki
sudo pip3 install beautifulsoup4 html5lib
bash ./Bootstrap.sh
sh ./GitHub.Main.sh
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4

View File

@ -2,17 +2,15 @@ image: alpine:latest
before_script: |
apk update
apk add wget npm python3 py3-pip
apk add git wget npm python3 py3-pip
npm install -g tiddlywiki
pip3 install beautifulsoup4 html5lib
pages:
stage: deploy
script: |
./Bootstrap.sh
ash ./Bootstrap.sh
sh ./GitLab.Main.sh
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH

View File

@ -23,7 +23,6 @@ cd ..
mv ./Repo/* ./Repo.tmp/
mv ./Repo.tmp/* ./Repo/
# Move everything to the working directory and on to the next step
# Move everything to the working directory, ready for the next steps
mv ./Repo/* ./
chmod +x *.sh
./Main.sh

13
GitLab.CrossRepoSync.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
TargetRepo="OcttKB.Raw"
git clone --depth 1 https://gitlab.com/octtspacc/$TargetRepo ./$TargetRepo
cd ./$TargetRepo
rm -rf ./Wiki
tiddlywiki \
--verbose \
--load ../public/index.html \
--output ./Wiki \
--savewikifolder ./Wiki
git add .
git commit -m "OcttKB Cross-Repo Sync (HTML to Raw)"
git push

View File

@ -1,7 +1,7 @@
<!doctype html>
<!-- The following comment is called a MOTW comment and is necessary for the TiddlyIE Internet Explorer extension -->
<!-- saved from url=(0021)https://tiddlywiki.com -->
<!-- saved from url=(0021)https://tiddlywiki.com -->
<html lang="en-GB">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
@ -247,7 +247,10 @@ Error message and password prompt
{"created":"20230111154758023","text":"/*\\\nLoad our custom polyfills, for old browsers support.\n\\*/\nexports.startup = function() {\ntry {\n\n// https://stackoverflow.com/a/63958411\nString.prototype.replaceAllTxt = function replaceAll(search, replace) {\n return this.split(search).join(replace);\n};\n\n} catch(e) {\n const Str = `${e.stack.split('\\n')[0]}: ${e}`\n console.log(Str);\n return Str;\n};\n};","tags":"","title":"$:/OcttKB/Polyfills.js","modified":"20230112185932820","type":"application/javascript","module-type":"startup"},
{"created":"20230126082147025","creator":"Octt","text":"#!/bin/sh\ncd ./public\n\n# Build single-page no-JS wiki\ntiddlywiki \\\n\t--load index.html \\\n\t--output ./ \\\n\t--rendertiddler $:/core/templates/static.template.css Style.css text/plain \\\n\t--rendertiddler $:/core/templates/alltiddlers.template.html Static.html text/plain\n\n# Fix errors in the resulting HTML\ncat \u003C\u003C EOF | python3\nfrom bs4 import BeautifulSoup;\nfrom re import sub;\nFile = 'Static.html'\ndef Fix1(m): return f'\u003Cdetails>\u003Ca name=\"{m.group(1)}\">\u003C/a>\u003Csummary>{m.group(2)}\u003C/summary>';\nSource = str(BeautifulSoup(open(File, 'r'), 'html5lib'));\nopen(File, 'w').write(sub('\u003Cdetails>\u003Ca name=\"(.+)\">\u003Csummary>(.+)\u003C\\/summary>\\s*\u003C\\/a>', Fix1, Source));\nEOF\n","title":"$:/OcttKB/Repo/Build.sh","modified":"20230225230248038","modifier":"Octt","type":"text/plain"},
{"created":"20230126082330667","creator":"Octt","text":"#!/bin/sh\nURL=\"https://kb.octt.eu.org\"\ncd ./public\nwget -O \"./-1.html\" \"$URL\" || true\nwget -O \"./-2.html\" \"$URL/-1.html\" || true\n","title":"$:/OcttKB/Repo/DeployOld.sh","modified":"20230126082445095","modifier":"Octt","type":"text/plain"},
{"created":"20230126081754717","creator":"Octt","text":"#!/bin/sh\n./Build.sh\n./DeployOld.sh\n","tags":"","title":"$:/OcttKB/Repo/Main.sh","modified":"20230126082102765","modifier":"Octt","type":"text/plain"},
{"created":"20230228080039630","creator":"Octt","text":"#!/bin/sh\nsh ./Main.sh\n","tags":"","title":"$:/OcttKB/Repo/GitHub.Main.sh","modified":"20230228080122141","modifier":"Octt","type":"text/plain"},
{"created":"20230228075916930","creator":"Octt","text":"#!/bin/sh\nsh ./Main.sh\nsh ./SetupGitProfile.sh\nCommitCheck=\"$(git log -1 --pretty=%B)\"\nCommitMsg0=\"OcttKB Cross-Repo Sync\"\n[ \"$CommitCheck\" != \"$CommitMsg0 (HTML to Raw)\" ] && [ \"$CommitCheck\" != \"$CommitMsg0 (Raw to HTML)\" ] && sh ./GitLab.CrossRepoSync.sh\n","tags":"","title":"$:/OcttKB/Repo/GitLab.Main.sh","modified":"20230228093123078","modifier":"Octt","type":"text/plain"},
{"created":"20230126081754717","creator":"Octt","text":"#!/bin/sh\nsh ./Build.sh\nsh ./DeployOld.sh\n","tags":"","title":"$:/OcttKB/Repo/Main.sh","modified":"20230228075239520","modifier":"Octt","type":"text/plain"},
{"created":"20230228081951095","creator":"Octt","text":"#!/bin/sh\ngit config --global user.email \"$GitUserEmail\"\ngit config --global user.name \"$GitUserName\"\ngit config --global credential.helper store\necho \"https://$GitUserName:$GitPassword@gitlab.com\" > ~/.git-credentials\n","title":"$:/OcttKB/Repo/SetupGitProfile.sh","modified":"20230228082144682","modifier":"Octt","type":"text/plain","tags":""},
{"created":"20230227073225540","creator":"Octt","text":"\u003Cdiv>\n\u003C$link to=\"OcttKB\" class=\"StartHere-Button\">[img[$:/ThirdParty/Icons/Windows/9x-Start.png]] \u003Cspan>here!\u003C/span>\u003C/$link>\n\u003C/div>","tags":"","title":"$:/OcttKB/StartButton","modified":"20230227073319615","modifier":"Octt"},
{"created":"20230112221909714","creator":"Octt","text":"\u003Cdiv style=\"Padding-Left:16px; Padding-Right:16px;\">\n\u003Ch1 class=\"tc-site-title\">\n[[OcttKB]]\n\u003C/h1>\n\u003Cdiv class=\"tc-site-subtitle\">\nOctt Knowledge Base || Powered by [[TiddlyWiki|TiddlyWiki]].\u003C/div>\n\u003Cp>\n\u003Cb>Note\u003C/b>: You're viewing the no-JS version of this site, some features will be missing. For the best experience, \u003Ca href=\"./\">load the full version\u003C/a>.\n\u003C/p>\n\u003C/div>\n\n{{$:/OcttKB/StartButton}}","modified":"20230227073428911","title":"$:/OcttKB/StaticBanner","tags":"","modifier":"Octt"},
{"created":"20230110181206539","text":"\\import [[$:/ThirdParty/TiddlyTools/FilterGenerators/TagCloud]]\n\n\\define config() $:/config/TiddlyTools/TagCloud\n\\define options() $:/state/popup/tagcloud\n\\define default_min() 0.75\n\\define default_step() 0.25\n\\define default_max() 3.00\n\\define default_group() 5\n\n\u003Cstyle>\n.tc-tag-label { white-space: normal !important; }\n.tc-tag-list-item { padding: 2px; }\n .tt-tagcloud input { width:auto !important; }\n .tt-tagcloud input.option { width:3em !important; text-align:right; }\n\u003C/style>\n\n\u003Cdiv class=\"tt-tagcloud\">\n\u003C!--\u003C\u003Ctagcloud_select>>--->\n\u003C!--\u003C$set name=taglist filter=\"[\u003Cconfig>get[taglist]enlist-input[]]\">--->\n\u003C$set name=taglist filter=\"[tags[]!is[system]]\">\n\u003C!--\u003C\u003Ctagcloud_summary>>--->\n\u003C\u003Ctagcloud_show>>\n","tags":"","title":"$:/OcttKB/TagCloud","modified":"20230110182005662"},
@ -347,7 +350,7 @@ Error message and password prompt
{"created":"20221109144756834","title":"$:/state/add-plugin-info/$:/temp/ServerConnection/https://tobibeer.github.io/tw5-plugins/library/index.html/$:/temp/RemoteAssetInfo/https://tobibeer.github.io/tw5-plugins/library/index.html/$:/plugins/tobibeer/split","text":"yes","modified":"20230116211830913"},
{"created":"20221109162512951","title":"$:/state/add-plugin-info/$:/temp/ServerConnection/https://tobibeer.github.io/tw5-plugins/library/index.html/$:/temp/RemoteAssetInfo/https://tobibeer.github.io/tw5-plugins/library/index.html/$:/plugins/tobibeer/value","text":"no","modified":"20230108200106539"},
{"created":"20221109142817793","creator":"Octt","title":"$:/state/addplugins/tab-1342078386","text":"$:/config/OfficialPluginLibrary","modified":"20230219212336934","modifier":"Octt"},
{"created":"20230109143853256","creator":"Octt","title":"$:/state/advancedsearch/currentTab","text":"$:/core/ui/AdvancedSearch/System","modified":"20230225142154702","modifier":"Octt"},
{"created":"20230109143853256","creator":"Octt","title":"$:/state/advancedsearch/currentTab","text":"$:/core/ui/AdvancedSearch/Filter","modified":"20230228085108974","modifier":"Octt"},
{"created":"20230203222356189","creator":"Octt","title":"$:/state/commander/log-tiddler","text":"$:/temp/commander/logs/tid-1","modified":"20230207221707250","modifier":"Octt"},
{"created":"20230117113820190","creator":"Octt","title":"$:/state/commander/reveal/$:/plugins/kookma/commander/search/selection-668442618","text":"open","modified":"20230206203755250","modifier":"Octt"},
{"created":"20230203222519483","creator":"Octt","title":"$:/state/commander/snr/select-tiddler","text":"","modified":"20230209170836660","modifier":"Octt"},
@ -355,6 +358,7 @@ Error message and password prompt
{"created":"20230112111303249","title":"$:/state/edit/references--1005422481","text":"show","modified":"20230112111303250"},
{"created":"20230208214227076","creator":"Octt","title":"$:/state/edit/references--139230202","text":"hide","modified":"20230208214229255","modifier":"Octt"},
{"created":"20220920193053266","title":"$:/state/edit/references--1487996250","text":"hide","modified":"20220920193054202"},
{"created":"20230228074539102","creator":"Octt","title":"$:/state/edit/references--1714985299","text":"hide","modified":"20230228074540087","modifier":"Octt"},
{"created":"20230124190502230","creator":"Octt","title":"$:/state/edit/references--1868471342","text":"hide","modified":"20230124190502918","modifier":"Octt"},
{"created":"20230109220441051","title":"$:/state/edit/references--2031574088","text":"show","modified":"20230109220446292"},
{"created":"20230124145100757","creator":"Octt","title":"$:/state/edit/references--2108521478","text":"hide","modified":"20230124145101414","modifier":"Octt"},
@ -460,7 +464,7 @@ Error message and password prompt
{"created":"20220922115715109","creator":"Octt","title":"$:/state/tab--1091387428","text":"$:/Octt/Music Archiving Status/Android52","modified":"20230225114340686","modifier":"Octt"},
{"created":"20230209145707201","creator":"Octt","title":"$:/state/tab--1421386850","text":"$:/core/ui/TiddlerInfo/Tools","modified":"20230209145717889","modifier":"Octt"},
{"created":"20230217120532762","creator":"Octt","title":"$:/state/tab--1440231522","text":"$:/plugins/tiddlywiki/text-slicer/docs/usage","modified":"20230217120533957","modifier":"Octt"},
{"created":"20230109143853256","creator":"Octt","title":"$:/state/tab--1498284803","text":"$:/core/ui/AdvancedSearch/System","modified":"20230225142154703","modifier":"Octt"},
{"created":"20230109143853256","creator":"Octt","title":"$:/state/tab--1498284803","text":"$:/core/ui/AdvancedSearch/Filter","modified":"20230228085108980","modifier":"Octt"},
{"created":"20230117125310625","creator":"Octt","title":"$:/state/tab--1581376822","text":"$:/plugins/flibbles/relink/ui/TiddlerInfo/References","modified":"20230117125313877","modifier":"Octt"},
{"created":"20230110152826768","title":"$:/state/tab--1588928600","text":"$:/core/ui/TiddlerInfo/Fields","modified":"20230110152833719"},
{"created":"20220920191426046","title":"$:/state/tab--1885964178","text":"$:/core/ui/TiddlerInfo/Tools","modified":"20220920191431231"},
@ -488,7 +492,7 @@ Error message and password prompt
{"created":"20230110152841020","title":"$:/state/tab-914888664","text":"$:/core/ui/TiddlerInfo/References","modified":"20230110152841020"},
{"created":"20220921221238452","creator":"Octt","title":"$:/state/tab-99014043","text":"$:/core/ui/ControlPanel/TiddlerIcon","modified":"20230218224826352","modifier":"Octt"},
{"created":"20220920114911876","creator":"Octt","title":"$:/state/tab/moresidebar-1850697562","text":"$:/core/ui/MoreSideBar/Explorer","modified":"20230219110733044","modifier":"Octt"},
{"created":"20220920092307479","creator":"Octt","title":"$:/state/tab/sidebar--595412856","text":"$:/core/ui/SideBar/Recent","modified":"20230227224452216","modifier":"Octt"},
{"created":"20220920092307479","creator":"Octt","title":"$:/state/tab/sidebar--595412856","text":"$:/core/ui/SideBar/More","modified":"20230228092739067","modifier":"Octt"},
{"created":"20220920114638764","creator":"Octt","title":"$:/state/tabs/controlpanel/toolbars-1345989671","text":"$:/core/ui/ControlPanel/Toolbars/PageControls","modified":"20230128224606306","modifier":"Octt"},
{"created":"20230109231545587","text":"inline","title":"$:/state/tag-cloud-count","modified":"20230109231831243"},
{"created":"20230221195052164","creator":"Octt","title":"$:/state/toc/$:/ToC-$:/Apps-747701490","text":"close","modified":"20230225151202843","modifier":"Octt"},
@ -639,7 +643,7 @@ Error message and password prompt
{"created":"20220920211944968","text":"{{$:/OcttKB/StaticBanner}}","tags":"","title":"$:/StaticBanner","modified":"20230112221911675"},
{"title":"$:/status/RequireReloadDueToPluginChange","text":"no"},
{"created":"20230117123049592","creator":"O","title":"$:/status/UserName","text":"Octt","modified":"20230117123050206","modifier":"Oct"},
{"title":"$:/StoryList","created":"20230227182812369","creator":"Octt","text":"","list":"","modified":"20230227224248712","modifier":"Octt"},
{"title":"$:/StoryList","created":"20230228072927378","creator":"Octt","text":"","list":"","modified":"20230228092757232","modifier":"Octt"},
{"created":"20230114161404958","text":"/*\\\nCredits: 1337box by Leah Rowe, Creative Commons Zero 1.0\nInfo: \u003Chttps://vimuser.org/1337box.html>\n\\*/\n.f, .f * {\n position: fixed;\n max-width: 100%;\n max-height: 100%;\n top: 50%;\n left: 50%\n}\n.f * { transform: translate(-50%,-50%) }\n.f {\n display: none;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 999;\n background:rgba(0,0,0,0.8);\n}\n*:focus + .f { display:block; }\nimg { cursor:pointer; }\n","title":"$:/Styles/1337box/shadow.css","modified":"20230114163044372","type":"text/css","tags":""},
{"created":"20230124224040783","creator":"Octt","text":"\u003C!-- Original image is by \u003Chttps://bilibili.com> -->\n\u003C!-- \u003Cdiv -->\n\u003Ca\nclass=\"bilibili-back-to-top\"\ntitle=\"Cute little lolis from bilibili to help you reach the top of the page...\"\nstyle=\"\n\ndisplay: block; \nposition: fixed;\n/*\nbottom: 100px;\nright: 20px;\n*/\nz-index: 9999;\nbottom: 2px;\nleft: 2px;\ntransform: translateY(0px);\nwidth: 62px;\nheight: 85px;\n/*\nmargin-left: 602px;\n*/\ntransform: scale(0.5);\ncursor: pointer;\nbackground-image: url(https://s1.hdslb.com/bfs/static/jinkela/space/assets/space-to-top.png);\nbackground-position: -40px -44px;\n\n\" href=\"javascript:(function(){\n\nvar Select = [\n '.tc-story-river > .story-backdrop',\n '.tc-sidebar-scrollable .tc-sidebar-header .tc-site-title',\n];\nfor (var i=0; i \u003C Select.length; i++) {\n var Elem = document.querySelectorAll(Select[i])[0];\n Elem.scrollIntoView({behavior: 'smooth'});\n};\n/*alert('TODO animation');*/\n\n})();\">\u003C/a>\n\u003C!--\n\" onclick=\"\n\">\u003C/div>\n-->","tags":"$:/tags/AboveStory","title":"$:/Styles/bilibili-back-to-top.html","modified":"20230218174510343","modifier":"Octt"},
{"created":"20230126091040410","creator":"Octt","text":"\\import [[$:/Macros/Styles]]\n\n\\define River() .tc-story-river\n\\define SRiver() .tc-static-story-river\n\\define Frame() .tc-tiddler-frame\n\\define Titler() .tc-tiddler-title\n\n\u003C\u003CRiver>> > \u003C\u003CFrame>> \u003C\u003CTitler>> .tc-title { \u003C\u003CNoDisp>> }\n\n.tc-story-river > .tc-tiddler-frame > .View-Breadcrumbs {\n opacity: 0.80;\n/*\n font-size: xx-large;\n margin-top: 0px;\n margin-bottom: -1.5em;\n position: sticky;\n z-index: 512;\n*/\n}\n.tc-story-river > .tc-tiddler-frame:not(.tc-tiddler-missing) > .View-Breadcrumbs > * {\n /*font-style: normal !important;*/\n opacity: 0.40;\n}\n.tc-story-river > .tc-tiddler-frame:not(.tc-tiddler-missing) > .View-Breadcrumbs:hover > * { opacity: 0.80; }\n.tc-story-river > .tc-tiddler-frame .View-Breadcrumbs > .Inline-Icon > * {\n width: 1em;\n height: 1em;\n vertical-align: top;\n}\n\n/*.View-Breadcrumbs { display: inline-flex; }*/\n\n/*.View-Breadcrumbs > .Inline-Sep:not(.View-Breadcrumbs > .Inline-Sep:last-of-type):before*/\n.View-Breadcrumbs > .Inline-Sep { padding-left: 0.3em; padding-right: 0.3em; }\n.View-Breadcrumbs > .Inline-Sep:after { content: '>'; font-size: smaller; }\n.View-Breadcrumbs > .Inline-Sep > span { font-size: 0px; }\n\n.View-Breadcrumbs > .Path-Elem[data-path-elem=\"$:\"] > a,\n.View-Breadcrumbs > .Path-Elem[data-path-elem=\"$:\"] + .Inline-Sep\n{ color: gray; padding-left: 0em; }\n\n.View-Breadcrumbs > .Path-Elem[data-path-elem=\"$:\"] + .Inline-Sep:after { content: ''; }\n.View-Breadcrumbs > .Path-Elem[data-path-elem=\"$:\"] + .Inline-Sep > span { font-size: revert; font-size: smaller; }\n\n.View-Breadcrumbs > .Path-Elem:last-of-type { cursor: pointer; }\n.View-Breadcrumbs details { display: inline; vertical-align: top; }\n\n.tc-static-story-river > .tc-tiddler-frame > .tc-tiddler-title details > summary,\n.View-Breadcrumbs details > summary {\n list-style: none;\n}\n\n.tc-static-story-river > .tc-tiddler-frame > .tc-tiddler-title details > .tc-tree,\n.View-Breadcrumbs details > .tc-tree {\n font-size: initial; line-height: 1rem;\n}\n\n.tc-static-story-river > .tc-tiddler-frame > .tc-tiddler-title details > .tc-tree > span,\n.View-Breadcrumbs details > .tc-tree > span {\n display: none;\n}\n\n.tc-static-story-river > .tc-tiddler-frame > .tc-tiddler-title .Path-Copy { display: none; }\n\n.View-Breadcrumbs > .Path-Copy {\n margin-left: 0.3em;\n margin-right: 0.3em;\n text-decoration: none;\n font-size: smaller;\n}\n","title":"$:/Styles/Breadcrumbs","modified":"20230226210549362","modifier":"Octt","tags":"$:/tags/Stylesheet"},