Skip to content

Instantly share code, notes, and snippets.

@rduarte
Created September 23, 2011 14:58
Show Gist options
  • Save rduarte/1237574 to your computer and use it in GitHub Desktop.
Save rduarte/1237574 to your computer and use it in GitHub Desktop.
# Instalar no o Ubuntu Server 10.04 32bits
# 1. Nome do host: nuntec-xx
# 2. Desmarcar TODOS os daemons
# 3. Definir primeiro usuário:
# Usuário: deploy
# Senha: 14ggcb
sudo apt-get update
sudo apt-get install -y ssh
wget http://temp.nuntec.com.br/gta-gestor/ldc-key.tar.gz
tar -xvzf ldc-key.tar.gz
rm ldc-key.tar.gz
sudo apt-get dist-upgrade -y
sudo apt-get install -y build-essential apache2 apache2-prefork-dev libapr1-dev libaprutil1-dev libcurl4-openssl-dev libreadline5
wget http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise_1.8.7-2011.12_i386_ubuntu10.04.deb
sudo dpkg -i ruby-enterprise_1.8.7-2011.12_i386_ubuntu10.04.deb
rm ruby-enterprise_1.8.7-2011.12_i386_ubuntu10.04.deb
sudo gem update --system
sudo apt-get install -y postgresql
sudo su postgres -c "psql -c \"ALTER USER postgres WITH PASSWORD 'CUvSOuewRc';\""
sudo apt-get install -y git-core
sudo apt-get install -y imagemagick libmagickcore-dev libmagickwand-dev
sudo gem install passenger -v 3.0.11 --no-rdoc --no-ri
sudo /usr/local/bin/passenger-install-apache2-module -a
sudo wget http://temp.nuntec.com.br/gta-gestor/passenger -O /etc/apache2/conf.d/passenger
sudo gem install bundler -v 1.0.21 --no-rdoc --no-ri
wget http://temp.nuntec.com.br/gta-gestor/instantclient_10_2.tar.gz
tar -xvzf instantclient_10_2.tar.gz
sudo cp instantclient_10_2/*.so* /usr/lib/
sudo ldconfig
export ORACLE_HOME=/home/deploy/instantclient_10_2
export LD_LIBRARY_PATH=/home/deploy/instantclient_10_2
git clone [email protected]:gta-gestor.git
cd gta-gestor
git checkout 1.3-lubrificacao
sudo env LD_LIBRARY_PATH=$LD_LIBRARY_PATH ORACLE_HOME=$ORACLE_HOME bundle install
bundle exec rake db:create RAILS_ENV=production
bundle exec rake db:migrate RAILS_ENV=production
bundle exec rake db:seed RAILS_ENV=production
sudo a2dissite default
sudo rm /etc/apache2/sites-available/default
sudo wget http://temp.nuntec.com.br/gta-gestor/gta-gestor-site -O /etc/apache2/sites-available/gta-gestor
sudo a2ensite gta-gestor
sudo /etc/init.d/apache2 restart
# Configurar dados do ORACLE no ~/gta-gestor/config/database.yml
# Importar registros do ORACLE: ./script/runner app/runners/import_from_ecr.rb
# Incluir importação automática no crontab
# crontab -e
# */5 * * * * cd /home/deploy/gta-gestor; /usr/local/bin/ruby script/runner -e production app/runners/export_to_ecr.rb >> /home/deploy/gta-gestor/log/export_to_ecr.log 2>&1
# 30 0 * * * cd /home/deploy/gta-gestor; /usr/local/bin/ruby script/runner -e production app/runners/import_from_ecr.rb >> /home/deploy/gta-gestor/log/import_from_ecr.log 2>&1
# Verificar as tarefas incluídas no crontab do usuário
# crontab -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment