Skip to content

Instantly share code, notes, and snippets.

@oranie
Created November 19, 2018 07:59
Show Gist options
  • Save oranie/adc2b34e2ae04bc6cd239a41053152db to your computer and use it in GitHub Desktop.
Save oranie/adc2b34e2ae04bc6cd239a41053152db to your computer and use it in GitHub Desktop.
VERSION="3.2.0"
CPU=`grep processor /proc/cpuinfo | wc -l`
sudo yum -y install openssl-devel libxml2-devel gcc gcc-c++ ruby22-devel git patch vim readline-devel rpm-build autoconf htop
sudo update-alternatives --set ruby /usr/bin/ruby2.2
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
source .bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
MAKE_OPTS="-j $CPU" rbenv install 2.4.2
rbenv global 2.4.2
git clone https://github.com/treasure-data/omnibus-td-agent.git
cd ./omnibus-td-agent/
git branch -m master remotes/origin/td-agent-$VERSION
git checkout -b refs/tags/td-agent-$VERSION
git pull origin td-agent-$VERSION
gem install bundle
bundle install --binstubs --jobs=$CPU
BUILD_TD_AGENT_VERSION=3 bin/gem_downloader core_gems.rb
BUILD_TD_AGENT_VERSION=3 bin/gem_downloader plugin_gems.rb
sudo mkdir -p /opt/td-agent /var/cache/omnibus && sudo chown ec2-user /opt/td-agent && sudo chown ec2-user /var/cache/omnibus
bin/omnibus build td-agent3
echo "end"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment