Sign In

Close
Forgot your password? No account yet?

Weasyl's deployment by catalepsy

Weasyl's deployment

catalepsy

This is approximately what it looks like when ~catalepsy, ~inaki, ~weykent, or ~struguri deploy weasyl

#!/bin/zsh
set -e
autoload colors
colors
cecho () {
local color="$1"
shift
echo "${fg[$color]}$@${reset_color}"
}

cecho cyan "TIME. TO. DEPLOY. WEASYL."
echo

if [[ $(id -u) != 0 ]]; then
cecho red "You're not root! You can't do this!"
exit 1
fi

host="$(hostname -s)"
update-git () {
(cd "$1" && sudo -u weasyl sh -c \
"git fetch origin +${host}:upstream/${host} && git reset --hard upstream/${host}")
}

echo
cecho green " ~ updating git for static files"
update-git ~weasyl/weasyl
cecho green " ~ running 'make'"
[ -f ~weasyl/weasyl/Makefile ] && (cd ~weasyl/weasyl && sudo -u weasyl make)

cecho green " ~ updating git for each backend"
for checkout in ~weasyl/weasyl_*; do
update-git "$checkout"
done

echo
/config/_deploy/kick-backends.sh || {
echo "code deploy failed while kicking backends over" | \
/config/_deploy/irccat.py 'ssl:irc.weasyl.com:6697' \
"irc_nickname=$host" 'target=#weasyl-dev'
exit 1
}

gitlog=$(cd ~weasyl/weasyl && git log -n1 --oneline)
echo
cecho cyan "It got deployed!"
echo "new weasyl deployment: $gitlog" | \
/config/_deploy/irccat.py 'ssl:irc.weasyl.com:6697' \
"irc_nickname=$host" 'target=#weasyl-dev'

Submission Information

Views:
410
Comments:
0
Favorites:
1
Rating:
General
Category:
Visual / Traditional

Tags