blob: 139f2ebf20e3daa0cff8e43f07737f965c959419 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#!/bin/sh
if [ "$1" = "test" ]; then
branch='test'
location='/var/www/html-test'
echo 'deploying to test.jjanzen.ca'
elif [ "$1" = "main" ]; then
branch='main'
location='/var/www/html'
echo 'deploying to jjanzen.ca'
else
echo 'unrecognized mode'
exit 1
fi
rm -rf "$HOME/public_html"
cd ~/website || exit
git checkout "$branch"
git clean -f
git pull
cd ~/dotfiles || exit
git checkout "$branch"
git clean -f
git pull
cd ~/blog || exit
git checkout "$branch"
git clean -f
git pull
cp "$HOME/website/deploy.sh" /usr/local/bin
cd ~/dotfiles || exit
~/website/fix-dotfile-paths.sh
emacs --batch -f package-initialize --script ~/website/publish.el
~/website/post-publish.sh
sed -i 's/) <a href=\"blog\//) <a href=\".\//' ~/public_html/blog/index.html
/bin/cp -r "$HOME/public_html"/* "$location"
chown -R apache:apache "$location"
chmod -R 775 "$location"
|