_build.sh 465 Bytes
Newer Older
Elias Ojala's avatar
Elias Ojala committed
1
2
3
4
#!/usr/bin/env bash

# Intended to be run on server.
EXPECTED_HOSTNAME="fi1"
Elias Ojala's avatar
Elias Ojala committed
5
6
7
8
export HOME="/home/eliaso"

export GEM_HOME="$HOME/.gems"
export PATH="$HOME/.gems/bin:$PATH"
Elias Ojala's avatar
Elias Ojala committed
9
10

if [ "$(hostname)" == $EXPECTED_HOSTNAME ]; then
Elias Ojala's avatar
Elias Ojala committed
11
    git pull
Elias Ojala's avatar
Elias Ojala committed
12
    rm -rf _site/
Elias Ojala's avatar
Update    
Elias Ojala committed
13
14
    rm -rf /var/www/wiki.lelux.fi/*
    bundle exec jekyll build --destination=/var/www/wiki.lelux.fi/
Elias Ojala's avatar
Elias Ojala committed
15
16
else
    echo "You're running it on \"$(hostname)\". You're supposed to run it on \"$EXPECTED_HOSTNAME\"!"
Elias Ojala's avatar
Update    
Elias Ojala committed
17
fi