-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP use variables to identify target repos, fix SSH key generation/au…
…thorization steps
- Loading branch information
Showing
2 changed files
with
9 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# requirements: git bash make python3-pip python3-venv | ||
SHELL := /bin/bash | ||
MARKDOWN_REPOSITORY = awesome-selfhosted/awesome-selfhosted | ||
HTML_REPOSITORY = nodiscc/awesome-selfhosted-html-preview | ||
|
||
.PHONY: install # install build tools in a virtualenv | ||
install: | ||
|
@@ -31,30 +33,30 @@ awesome_lint: install | |
.PHONY: export_markdown # render markdown export from YAML data (https://github.com/awesome-selfhosted/awesome-selfhosted) | ||
export_markdown: install | ||
rm -rf awesome-selfhosted/ | ||
git clone https://github.com/nodiscc/awesome-selfhosted | ||
git clone https://github.com/$(MARKDOWN_REPOSITORY) | ||
source .venv/bin/activate && hecat --config .hecat/export-markdown.yml | ||
cd awesome-selfhosted && git diff --color=always | ||
|
||
.PHONY: export_html # render HTML export from YAML data (https://nodiscc.github.io/awesome-selfhosted-html-preview/) | ||
export_html: install | ||
rm -rf awesome-selfhosted-html-preview/ html/ | ||
git clone https://github.com/nodiscc/awesome-selfhosted-html-preview | ||
git clone https://github.com/$(HTML_REPOSITORY) | ||
mkdir html && source .venv/bin/activate && hecat --config .hecat/export-html.yml | ||
sed -i 's|<a href="https://github.com/pradyunsg/furo">Furo</a>|<a href="https://github.com/nodiscc/hecat/">hecat</a>, <a href="https://www.sphinx-doc.org/">sphinx</a> and <a href="https://github.com/pradyunsg/furo">furo</a>. Content under <a href="https://github.com/awesome-selfhosted/awesome-selfhosted-data/blob/master/LICENSE">CC-BY-SA 3.0</a> license.|' .venv/lib/python*/site-packages/furo/theme/furo/page.html | ||
source .venv/bin/activate && sphinx-build -b html -c ./ html/md/ html/html/ | ||
rm -rf html/html/.buildinfo html/html/objects.inv html/html/.doctrees awesome-selfhosted-html-preview/* | ||
|
||
.PHONY: push_markdown # commit and push changes to the markdown repository | ||
push_markdown: | ||
cd awesome-selfhosted && git remote set-url origin [email protected]:nodiscc/awesome-selfhosted | ||
cd awesome-selfhosted && git remote set-url origin [email protected]:$(MARKDOWN_REPOSITORY) | ||
cd awesome-selfhosted && git config user.name awesome-selfhosted-bot && git config user.email [email protected] | ||
cd awesome-selfhosted && git add . && (git diff-index --quiet HEAD || git commit -m "[bot] build markdown repository") | ||
cd awesome-selfhosted && git push -f | ||
|
||
.PHONY: push_html # commit and push changes to the HTML site repository (amend previous commit and force-push) | ||
push_html: | ||
mv html/html/* awesome-selfhosted-html-preview/ | ||
cd awesome-selfhosted-html-preview/ && git remote set-url origin [email protected]:nodiscc/awesome-selfhosted-html-preview | ||
cd awesome-selfhosted-html-preview/ && git remote set-url origin [email protected]:$(HTML_REPOSITORY) | ||
cd awesome-selfhosted-html-preview/ && git config user.name awesome-selfhosted-bot && git config user.email [email protected] | ||
cd awesome-selfhosted-html-preview/ && git add . && (git diff-index --quiet HEAD || git commit --amend -m "[bot] build HTML site") | ||
cd awesome-selfhosted-html-preview/ && git push -f | ||
|