configure local testing
This commit is contained in:
parent
d0871c53cd
commit
40d1c7a867
5 changed files with 58 additions and 84 deletions
50
Makefile
50
Makefile
|
|
@ -4,7 +4,10 @@ site:
|
|||
serve: site
|
||||
cd _site && python -m SimpleHTTPServer 2> /dev/null || python3 -m http.server
|
||||
|
||||
dock: site
|
||||
site_local:
|
||||
./makesite.py --params params-local.json
|
||||
|
||||
dock: site_local
|
||||
docker run --name bloglocal -p 8000:8000 -v `pwd`/_site:/usr/share/nginx/html:ro -v `pwd`/local-nginx.conf:/etc/nginx/nginx.conf:ro nginx
|
||||
|
||||
undock:
|
||||
|
|
@ -34,49 +37,4 @@ clean:
|
|||
find . -name "*.pyc" -exec rm {} +
|
||||
rm -rf .coverage htmlcov
|
||||
|
||||
REV = cat /tmp/rev.txt
|
||||
example:
|
||||
#
|
||||
# Remove existing output directories.
|
||||
rm -rf _site /tmp/_site
|
||||
#
|
||||
# Create params.json for makesite-demo.
|
||||
echo '{ "base_path": "/makesite-demo", "site_url":' \
|
||||
'"https://tmug.github.io/makesite-demo" }' > params.json
|
||||
#
|
||||
# Generate the website.
|
||||
. ./venv && ./makesite.py
|
||||
rm params.json
|
||||
#
|
||||
# Get current commit ID.
|
||||
git rev-parse --short HEAD > /tmp/rev.txt
|
||||
#
|
||||
# Write a README for makesite-demo repository.
|
||||
echo makesite.py demo > _site/README.md
|
||||
echo ================ >> _site/README.md
|
||||
echo This is the HTML/CSS source of an example static >> _site/README.md
|
||||
echo website auto-generated with [sunainapai/makesite][makesite] >> _site/README.md
|
||||
echo "([$$($(REV))][commit])". >> _site/README.md
|
||||
echo >> _site/README.md
|
||||
echo Visit "<https://tmug.github.io/makesite-demo>" to >> _site/README.md
|
||||
echo view the example website. >> _site/README.md
|
||||
echo >> _site/README.md
|
||||
echo [makesite]: https://github.com/sunainapai/makesite >> _site/README.md
|
||||
echo [commit]: https://github.com/sunainapai/makesite/commit/$$($(REV)) >> _site/README.md
|
||||
echo [demo]: https://tmug.github.io/makesite-demo >> _site/README.md
|
||||
#
|
||||
# Publish makesite-demo.
|
||||
mv _site /tmp
|
||||
cd /tmp/_site && git init
|
||||
cd /tmp/_site && git config user.name Makesite
|
||||
cd /tmp/_site && git config user.email makesite@example.com
|
||||
cd /tmp/_site && git add .
|
||||
cd /tmp/_site && git commit -m "Auto-generated with sunainapai/makesite - $$($(REV))"
|
||||
cd /tmp/_site && git remote add origin https://github.com/tmug/makesite-demo.git
|
||||
cd /tmp/_site && git log
|
||||
cd /tmp/_site && git push -f origin master
|
||||
|
||||
loc:
|
||||
grep -vE '^[[:space:]]*#|^[[:space:]]*$$|^[[:space:]]*"""' makesite.py | wc -l
|
||||
|
||||
FORCE:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue