My own git-build.sh scripts

This commit is contained in:
southerntofu 2020-04-18 10:42:20 -04:00
commit c142d2804a
12 changed files with 54 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*.log
*.err
.*/

1
config/hostname Normal file
View File

@ -0,0 +1 @@
thunix.net

1
dnsmanager Symbolic link
View File

@ -0,0 +1 @@
zola

1
dnsmanager.source Normal file
View File

@ -0,0 +1 @@
https://tildegit.org/southerntofu/dnsmanager-website

24
git-build Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
# Verify ~/bin exists
[ ! -d $HOME/bin ] && mkdir $HOME/bin
# Add ~/bin to $PATH
grep "\$HOME/bin" $HOME/.bashrc > /dev/null
[[ $? != 0 ]] && PATH="$PATH:/$HOME/bin"
# Wait for git-build.sh to stop running
SECONDS=0
# TODO: make timeout configurable
echo test
while [[ $SECONDS < 60 ]]; do
if [ ! -f $GITBUILDDIR/.LOCK ]; then
# Copy the script
cp git-build.sh $HOME/bin
exit 0
fi
sleep 5
SECONDS=$(( SECONDS + 5 ))
done
echo "The auto-updated script has timed out!"

1
git-build.source Normal file
View File

@ -0,0 +1 @@
https://tildegit.org/southerntofu/git-build.sh

1
rfc Symbolic link
View File

@ -0,0 +1 @@
zola

1
rfc.branch Normal file
View File

@ -0,0 +1 @@
drafts

1
rfc.source Normal file
View File

@ -0,0 +1 @@
https://tildegit.org/southerntofu/rfcs

1
tilde-fr Symbolic link
View File

@ -0,0 +1 @@
zola

1
tilde-fr.source Normal file
View File

@ -0,0 +1 @@
https://tildegit.org/tilde-fr/site

18
zola Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
[[ $# = 0 ]] && echo "ERROR" && exit 1
ARGS=""
if [ -f $GITBUILDDIR/config/hostname ]; then
base_url="https://$(cat $GITBUILDDIR/config/hostname)/~$USER/$1"
ARGS="$ARGS -u $base_url"
fi
zola build $ARGS
if [[ $? != 0 ]]; then
echo "Building site $1 failed."
exit 2
fi
rm -R ~/public_html/$1
cp -R public ~/public_html/$1
rm -R public