diff --git a/setup b/setup new file mode 100644 index 0000000..68f0c11 --- /dev/null +++ b/setup @@ -0,0 +1,53 @@ +#!/bin/bash +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 3 of +# the License or any later version accepted by the membership of +# KDE e.V. (or its successor approved by the membership of KDE +# e.V.), which shall act as a proxy defined in Section 14 of +# version 3 of the license. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Tiny script to setup janitor@bugs.kde.org + +# Setup bin folder. +[ -d $HOME/bin ] || mkdir -pv $HOME/bin +[ -e $HOME/bin/ruby ] || ln -sv /usr/bin/ruby2.0 $HOME/bin/ruby + +cat << EOF > $HOME/bin/run_bot +#!/bin/bash + +set -ex +source ~/.profile + +pushd $HOME/bugzilla-bot +git pull --rebase +popd + +export PRODUCTION=1 +export AUTOMATIC=1 +exec $HOME/bugzilla-bot/bin/bugzillabot +EOF +chmod +x bin/run_bot + +# Install bundler +# https://bugs.launchpad.net/ubuntu/+source/ruby2.0/+bug/1777174 +ruby -r yaml -r rubygems/safe_yaml -S gem install bundler --user-install + +# Setup a profile +[ -e $HOME/.bash_profile ] || ln -sv .profile $HOME/.bash_profile +echo 'export PATH=$HOME/bin:$PATH' > $HOME/.profile +# GEM_HOME so bundler knows where to go +echo 'export GEM_HOME=$(ruby -rubygems -e "puts Gem.user_dir")' >> .profile +echo 'export PATH=$GEM_HOME/bin:$PATH' >> .profile + +echo 'relog to apply environment' +echo 'bundling needs to be done manually!'