#!/bin/bash
DOMAIN=[domain-name]
GIT_REPO=/var/repos/[repo-name].repo.git
WORKING_DIRECTORY=/tmp/$DOMAIN
PUBLIC_WWW=/var/www/$DOMAIN
BACKUP_WWW=/tmp/$DOMAIN-backup
set -e
rm -rf $WORKING_DIRECTORY
rsync -aqz $PUBLIC_WWW/ $BACKUP_WWW
trap "echo 'A problem occurred. Reverting to backup.'; rsync -aqz --del $BACKUP_WWW/ $PUBLIC_WWW; r
m -rf $WORKING_DIRECTORY" EXIT
git clone $GIT_REPO $WORKING_DIRECTORY
git clone https://github.com/[them] $WORKING_DIRECTORY/themes/beautifulhugo
# The following section should be changed to use rsync so that it nicely updates
# the directory instead of making it blank.
rm -rf $PUBLIC_WWW/*
hugo -s $WORKING_DIRECTORY -d $PUBLIC_WWW -b "http://${DOMAIN}"
rm -rf $WORKING_DIRECTORY
Push to GitHub Triggers Push to Remote
Hi. Today I would like to go over how I changed things up a bit and am now able to push my site updates to GitHub, which then pushes the updates to the live production server. This should allow me to add checks within GitHub to ensure my site it updated only if everything is correct. Though I won’t go into that here today. I will be focusing on the GitHub Action.
[Read More]Auto Update Site from a Git Push
Pushing directly from Dev Server to Remote Production Server
Hi,
For a little while now I have been thinking about moving my personal blog to a self-hosted service. One of the options I have been considering is Linode.
As part of this idea. I wanted to see how I might be able to automate some of the processes. This is just a write up on one of my ideas so far.
[Read More]Send a notification through LINE with AppDaemon with Home Assistant
The challenge
Living in Japan we generally default to using LINE for our messaging needs. At the time of this writing there is no integration for LINE within Home Assistant. Currently I use PushOver for some of my Home Assistant notifications. I also use Zapier with email to trigger notifications to my family LINE group. You can see how I did this here and here.
[Read More]Use launchd instead of crontab on your Mac
As of Mac OS 10.4 crontab has been depreciated but not ended. So its a good idea to know how to use its replacement under Mac OS. Welcome to Launchd.
This will be a short guide on how to use launchd in a simple form to replace a crontab job. In my case I am automating the backup of my Plex server. You can see my previous article here
Launchd has a lot of other features. I will not look at them here.
[Read More]Delay Services launch until external drive mount is complete
The Challenge
How to give Drobo time to mount before processes that need access to it begin and hence block it’s mounting by having the mount point in use.
[Read More]