testing some stuff

This commit is contained in:
Greg Gauthier 2023-01-24 18:52:09 +00:00
parent 490a9f825e
commit 182ccb60c4
5 changed files with 77 additions and 0 deletions

7
build Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env sh
# commit and push...
git add .;git commit -m"$@";git push -u origin master
# build the site
hugo -D

11
extract Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
if [[ -z "$1" ]]; then
echo "Supply the full filepath of the video from which to extract audio"
exit 1
fi
filename=$(basename -- "${1}")
filename="${filename%.*}"
ffmpeg -i "${1}" -f mp3 -ab 192000 -vn "${filename}.mp3"

22
hugo-server Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env bash
export LOG=./logs/hugo-server.log
if ! [ -z "$1" ]; then
if [[ "$1" == "start" ]]; then
hugo server -D --disableFastRender --enableGitInfo -v --debug > $LOG 2>&1 &
echo "Server started on $(pidof hugo)"
elif [[ "$1" == "stop" ]]; then
kill -9 $(pidof hugo)
elif [[ "$1" == "status" ]]; then
pid=$(pidof hugo)
if ! [ -z "$pid" ]; then
echo "Hugo Server Active. PID: ${pid}"
else
echo "Hugo Server Is Inactive."
fi
fi
else
echo "You can 'start' or 'stop' the server, or get the 'status'."
exit 1
fi

12
publish Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env sh
# commit and push...
git add .;git commit -m"$@";git push -u origin master
rm -rf public # destroy the old build first
hugo # build the new site
sudo chown -R gmgauthier:www-data ./public/* # set the ownership before transfer
rsync --super -avh -e ssh ./public/* gmgauthier@boethius:/hosting/sites/gmgauthier.com
# echo "ls -lA /hosting/sites/gmgauthier.com" | ssh gmgauthier@boethius /bin/bash

25
push-asset Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env bash
if [[ -z "$1" ]]; then
echo "Supply a file with full path to be published"
exit 1
fi
file=$(basename "${1}")
# The assumption is all images are for the blog
if [[ "$1" =~ .*\.(gif|jpg|png) ]]; then
s3cmd put -P "${1}" s3://gmgauthier/blog/img/"${file}"
fi
# The assumption is all audio is for the podcast
if [[ "$1" =~ .*\.(mp3|ogg|wav) ]]; then
s3cmd put -P "${1}" s3://gmgauthier/podcast/audio/"${file}"
fi
# The assumption is all video is generic
if [[ "$1" =~ .*\.(mp4|mkv|m4v) ]]; then
s3cmd put -P "${1}" s3://gmgauthier/videos/"${file}"
fi