Skip to content

Instantly share code, notes, and snippets.

@woozyking
Last active January 2, 2016 14:49
Show Gist options
  • Save woozyking/8319390 to your computer and use it in GitHub Desktop.
Save woozyking/8319390 to your computer and use it in GitHub Desktop.
CentOS Disco Deplyment
#!/bin/bash
DISCO_USER=disco
# Update and clean cache
yum clean all -y
# Add EPEL repo
# http://wiki.centos.org/AdditionalResources/Repositories
# http://fedoraproject.org/wiki/EPEL
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm -O ~/epel.rpm
rpm -Uvh ~/epel.rpm
# Pull updates, install essential tools for compilation and what not
yum update -y
yum groupinstall "Development tools" -y
yum install xz-libs openssl-devel sqlite-devel bzip2-devel python-pycurl -y
# yum install git -y
# Install Erlang, primary dependency for Disco
yum install erlang -y
# Add disco user
useradd $DISCO_USER
# Make /etc/disco
mkdir -p /etc/disco
# Grab Disco and install to $DISCO_USER home folder
git clone git://github.com/discoproject/disco.git ~/DISCO_HOME
cd ~/DISCO_HOME
make install prefix="/home/$DISCO_USER"
# Granting rights to $DISCO_USER
chown $DISCO_USER:$DISCO_USER -R /etc/disco
chown $DISCO_USER:$DISCO_USER -R /home/$DISCO_USER
# Link the disco python packages to /usr/local/lib
mkdir -p /usr/local/lib/python2.6/site-packages
ln -s /home/$DISCO_USER/lib/python2.6/site-packages/* /usr/local/lib/python2.6/site-packages/
# Link two main executables to /usr/local/bin
mkdir -p /usr/local/bin/
ln -s /home/$DISCO_USER/bin/* /usr/local/bin/
# Link the disco python packages to /usr/lib and executables to /usr/bin
# NOTE: not a good idea unless we require root to execute and run disco jobs
# ln -s /home/$DISCO_USER/lib/python2.6/site-packages/* /usr/lib/python2.6/site-packages/
# ln -s /home/$DISCO_USER/bin/* /usr/bin/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment