Last active
August 29, 2015 13:56
-
-
Save dannysmith/9051803 to your computer and use it in GitHub Desktop.
CentOS Ruby TestAgent Setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # CentOS rbenv system wide installation script | |
| # Forked from https://gist.github.com/1237417 | |
| # Check that we're on Centos 6 and the x86_64 architecture | |
| cat /etc/redhat-release | |
| uname -m | |
| # Installs rbenv system wide on CentOS 5/6, also allows single user installs. | |
| #Check ruby is installed. | |
| ruby -v | |
| which ruby | |
| gem list | |
| # If it isn't installed, there's no need to install it now, just bear it in mind later. | |
| # Install pre-requirements | |
| yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel \ | |
| make bzip2 autoconf automake libtool bison iconv-devel git-core mysql-devel | |
| # Check if Git is installed | |
| hash git 2>&- || { | |
| echo >&2 "Error: Git not found."; | |
| exit 1; | |
| } | |
| # Check if /usr/local/rbenv already exists | |
| if [[ -d "/usr/local/rbenv" ]]; then | |
| echo >&2 "Error: /usr/local/rbenv already exists. Aborting installation."; | |
| exit 1; | |
| fi | |
| # Install rbenv | |
| git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv | |
| # Check if clone succesful | |
| if [ $? -gt 0 ]; then | |
| echo >&2 "Error: Git clone error! See above."; | |
| exit 1; | |
| fi | |
| # Add rbenv to the path | |
| echo '# rbenv setup - only add RBENV PATH variables if no single user install found' > /etc/profile.d/rbenv.sh | |
| echo 'if [[ ! -d "${HOME}/.rbenv" ]]; then' >> /etc/profile.d/rbenv.sh | |
| echo ' export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.sh | |
| echo ' export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/rbenv.sh | |
| echo ' eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh | |
| echo 'fi' >> /etc/profile.d/rbenv.sh | |
| chmod +x /etc/profile.d/rbenv.sh | |
| # Install ruby-build globally (rather than as a plugin see ruby-build README): | |
| pushd /tmp | |
| rm -rf /tmp/ruby-build | |
| git clone git://github.com/sstephenson/ruby-build.git | |
| # Check if clone succesful | |
| if [ $? -gt 0 ]; then | |
| echo >&2 "Error: Git clone error! See above."; | |
| exit 1; | |
| fi | |
| cd ruby-build | |
| ./install.sh | |
| popd | |
| # Install rehash plugin | |
| cd /usr/local/rbenv/plugins | |
| git clone git://github.com/sstephenson/rbenv-gem-rehash.git | |
| echo '---------------------------------' | |
| echo ' rbenv installed system wide to /usr/local/rbenv' | |
| echo ' Remember to restart your shell for the changes to take effect!' | |
| echo '---------------------------------' | |
| # Restart the shell | |
| exec $SHELL -l | |
| # Install rubies | |
| rbenv install 1.9.3-p484 | |
| rbenv install 2.0.0-p353 | |
| rbenv rehash | |
| rbenv global 2.0.0-p353 | |
| # Restart the shell | |
| exec $SHELL -l | |
| # Install generic ruby libs for 2.0 | |
| ruby -v | |
| gem update --system | |
| gem install hirb wirble bundler pry | |
| # Install generic ruby libs for 1.9 | |
| pushd /tmp | |
| rm -rf temp-foo | |
| cd temp-foo | |
| rbenv local 1.9.3-p484 | |
| gem update --system | |
| gem install hirb wirble bundler pry | |
| popd | |
| gem list | |
| # Install X Stuff so GUI sessions are possible with X Forwarding | |
| yum groupinstall Desktop | |
| yum install xorg-x11-xauth xterm tigervnc-server xorg-x11-fonts-Type1 vnc | |
| # Install Browsers | |
| yum install firefox.x86_64 | |
| # Install ffmpeg for video captures (See more at: http://datlinux.blogspot.co.uk/2013/04/how-to-install-ffmpeg-on-centos-via-yum.html) | |
| rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm | |
| yum install -y ffmpeg ffmpeg-devel | |
| # Install Chrome | |
| # BEWARE! This script does a lot of stuff and might break things or fail to install Chrome properly. Uncomment the next three lines to use it. | |
| # wget http://chrome.richardlloyd.org.uk/install_chrome.sh | |
| # chmod u+x install_chrome.sh | |
| # ./install_chrome.sh | |
| # Test Chrome works with `google-chrome &` as non-root user |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment