Update 2024.11.18 15:44:15 CET
This commit is contained in:
parent
0e3a24ab77
commit
288a6e97e9
2 changed files with 7 additions and 23 deletions
23
README.org
23
README.org
|
@ -13,7 +13,7 @@ The post-receive hook is like so:
|
||||||
#+begin_src sh
|
#+begin_src sh
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Directory on the server where the website will be mapped.
|
# Directory on the server where the website will be mapped.
|
||||||
export GIT_WORK_TREE=/srv/bajsicki.com
|
export GIT_WORK_TREE=/srv/bajsicki.com/
|
||||||
|
|
||||||
echo `pwd`
|
echo `pwd`
|
||||||
echo "post-receive: Generating https://bajsicki.com with Hugo..."
|
echo "post-receive: Generating https://bajsicki.com with Hugo..."
|
||||||
|
@ -24,27 +24,18 @@ chmod 755 $GIT_WORK_TREE
|
||||||
|
|
||||||
# Remove any files already in the public directory, a fresh copy will be generated by hugo
|
# Remove any files already in the public directory, a fresh copy will be generated by hugo
|
||||||
rm -rf $GIT_WORK_TREE/public
|
rm -rf $GIT_WORK_TREE/public
|
||||||
|
# Update the modules in case of changes and pull the new pages
|
||||||
|
cd $GIT_WORK_TREE && git pull --recurse-submodules
|
||||||
|
|
||||||
# Generate the site with hugo
|
# Generate the site with hugo
|
||||||
cd $GIT_WORK_TREE && chmod +x update.sh
|
cd $GIT_WORK_TREE && hugo
|
||||||
cd $GIT_WORK_TREE && ./update.sh
|
|
||||||
|
|
||||||
# Fix any permission problems.
|
# Fix any permission problems.
|
||||||
find $GIT_WORK_TREE/public -type f -print | xargs -d '\n' chmod 644
|
find $GIT_WORK_TREE/public -type f -print | xargs -d '\n' chmod 644
|
||||||
find $GIT_WORK_TREE/public -type d -print | xargs -d '\n' chmod 755
|
find $GIT_WORK_TREE/public -type d -print | xargs -d '\n' chmod 755
|
||||||
|
|
||||||
echo "post-receive: Hugo site generation complete"
|
echo "post-receive: Hugo site deployment complete"
|
||||||
#+end_src
|
|
||||||
|
|
||||||
The ~update.sh~ script is as dead simple as things get.
|
|
||||||
|
|
||||||
#+begin_src sh
|
|
||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
cd themes/hugo-tufte/
|
|
||||||
git reset --hard && git pull origin main -f
|
|
||||||
cd ../..
|
|
||||||
git reset --hard && git pull origin main -f
|
|
||||||
hugo
|
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
cd themes/hugo-tufte/
|
|
||||||
git reset --hard && git pull origin main -f
|
|
||||||
cd ../..
|
|
||||||
git reset --hard && git pull origin main -f
|
|
||||||
hugo
|
|
Loading…
Reference in a new issue