aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorThedro Neely <thedroneely@gmail.com>2022-11-13 23:09:01 -0500
committerThedro Neely <thedroneely@gmail.com>2022-11-13 23:09:01 -0500
commit2e219c7804c208545b0500b7da21334a58575e86 (patch)
treec56692dc5a383cde88c070af243a475099d32c9f /Makefile
parent2cd87e0b67c5372651aa390cddc9b9d658e2a20f (diff)
downloadthedroneely.com-2e219c7804c208545b0500b7da21334a58575e86.tar.gz
thedroneely.com-2e219c7804c208545b0500b7da21334a58575e86.tar.bz2
thedroneely.com-2e219c7804c208545b0500b7da21334a58575e86.zip
Makefile: Expose more deployment logic
Generalize partials
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile43
1 files changed, 35 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index d412684..878ad30 100644
--- a/Makefile
+++ b/Makefile
@@ -1,23 +1,40 @@
+all:
+ make webrings
+ make quotes
+ make references
+ make migration
+ make site
+ make admin
+ make migration
+
generators:
- make openring
- make fortune
+ make webrings
+ make quotes
+ make references
-openring:
+webrings:
generators/openring/openring \
-s "https://drewdevault.com/feed.xml" \
-s "https://mxb.dev/feed.xml" \
-s "https://www.taniarascia.com/rss.xml" \
< generators/openring/template.html \
- > generators/hugo/themes/tdro/layouts/partials/generators/openring/openring.html
+ > generators/hugo/themes/tdro/layouts/partials/webrings/openring.html
-fortune:
+quotes:
strfile generators/fortune/quotes.fortune
-hugo:
+references:
+ find generators/hugo/content/posts -type f -name "*.md" -exec basename --suffix '.md' {} \; \
+ | while read -r file; do path="generators/hugo/themes/tdro/layouts/partials/references/$$file.html" \
+ && printf 'Gathering references for %s\n' "$$file" && [ ! -e "$$path" ] \
+ && generators/exoference/exoference "$$(printf 'https://thedroneely.com/posts/%s/\n' "$$file")" > \
+ "$$path" || true ; done
+
+site:
ln -sfT ../../public generators/hugo/public
cd generators/hugo && hugo && { cd ../.. || exit 1; }
-cockpit:
+admin:
sed --in-place "s|^hugo_base_dir.*|hugo_base_dir: $$PWD/generators/hugo|" cockpit/addons/Hugo/config.yaml
sed --in-place "s|^hugo_theme.*|hugo_theme: tdro|" cockpit/addons/Hugo/config.yaml
@@ -25,4 +42,14 @@ migration:
sqlite3 database/sqlite.db < database/contactform.sql
sed --in-place "s|'sql:;dbname=sql_database'|'sqlite:' . __DIR__ . '/database/sqlite.db'|" config.php
-.PHONY: generators cockpit
+permissions:
+ find . -type f -print0 | xargs -0 chmod 640
+ find . -type d -print0 | xargs -0 chmod 770
+ chmod +x \
+ bootstrap/helpers/cache \
+ bootstrap/helpers/thumbnails \
+ generators/openring/openring
+ chmod g+w database/sqlite.db
+ find public/images -type f -exec touch -d "3 days ago" {} +
+
+.PHONY: generators admin