Last active
May 16, 2018 18:48
-
-
Save mr4torr/e2d41b14fe62ab7ff07ce22e6b145d80 to your computer and use it in GitHub Desktop.
Revisions
-
mr4torr renamed this gist
Jan 30, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
mr4torr revised this gist
May 7, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -24,7 +24,7 @@ $ vim post-update #!/bin/sh APP_PATH=/home/rails/balada export RAILS_ENV="production" export PATH="/usr/local/rvm/gems/ruby-2.2.2/bin:/usr/local/rvm/rubies/ruby-2.2.2/bin:$PATH" export GEM_PATH="/usr/local/rvm/gems/ruby-2.2.2:$GEM_PATH" BUNDLE=/usr/local/rvm/gems/ruby-2.2.2/bin/bundle -
mr4torr revised this gist
May 7, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -25,7 +25,7 @@ $ vim post-update APP_PATH=/home/rails/balada export RAILS_EN="production" export PATH="/usr/local/rvm/gems/ruby-2.2.2/bin:/usr/local/rvm/rubies/ruby-2.2.2/bin:$PATH" export GEM_PATH="/usr/local/rvm/gems/ruby-2.2.2:$GEM_PATH" BUNDLE=/usr/local/rvm/gems/ruby-2.2.2/bin/bundle -
mr4torr revised this gist
May 6, 2017 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -34,16 +34,16 @@ cd ${APP_PATH} echo '~> Post Update ============================' echo '- Bundle Install' RAILS_ENV=production $BUNDLE install echo '- DB Migration' RAILS_ENV=production $BUNDLE exec rake db:migrate echo '- Assets Precompile' RAILS_ENV=production $BUNDLE exec rake assets:precompile echo '- Assets Sync' RAILS_ENV=production $BUNDLE exec rake assets:sync echo '- Create folder tmp' mkdir -p tmp/ -
mr4torr revised this gist
May 6, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -61,6 +61,8 @@ $ chmod +x post-update PermitUserEnvironment yes ``` # Variaveis globais colocar no arquivo /etc/environment # Adicione os path da versao do ruby ``` -
mr4torr revised this gist
May 6, 2017 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -67,6 +67,12 @@ PermitUserEnvironment yes env | grep -E "^(GEM_HOME|PATH|RUBY_VERSION|MY_RUBY_HOME|GEM_PATH)=" > ~/.ssh/environment ``` # reinicie o ssh ``` sudo /etc/init.d/ssh restart ``` # no servidor local git remote add production ssh://[email protected]/home/repo/site.git -
mr4torr revised this gist
May 6, 2017 . 1 changed file with 13 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -55,5 +55,18 @@ touch tmp/restart.txt $ chmod +x post-update # Adicione ou altere no arquivo /etc/ssh/sshd_config ``` PermitUserEnvironment yes ``` # Adicione os path da versao do ruby ``` env | grep -E "^(GEM_HOME|PATH|RUBY_VERSION|MY_RUBY_HOME|GEM_PATH)=" > ~/.ssh/environment ``` # no servidor local git remote add production ssh://[email protected]/home/repo/site.git -
mr4torr created this gist
Jul 25, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,59 @@ # Entrar no servidor e fora da pasta do projeto $ cd /home $ mkdir repo && cd repo $ mkdir site.git && cd site.git $ git init --bare $ cd hooks $ vim post-receive ## Adicionar no arquivo ``` #!/bin/sh git --work-tree=/home/rails/site --git-dir=/home/repo/site.git checkout -f ``` $ chmod +x post-receive > /home/rails/site = pasta aonde esta o projeto > /home/repo/site.git = pasta aonde ficara o hook do git $ vim post-update ## Adicionar no arquivo ``` #!/bin/sh APP_PATH=/home/rails/balada export RAILS_EN="production" export PATH="/usr/local/rvm/gems/ruby-2.2.2/bin:$PATH" export GEM_PATH="/usr/local/rvm/gems/ruby-2.2.2:$GEM_PATH" BUNDLE=/usr/local/rvm/gems/ruby-2.2.2/bin/bundle cd ${APP_PATH} echo '~> Post Update ============================' echo '- Bundle Install' $BUNDLE install RAILS_ENV=production echo '- DB Migration' $BUNDLE exec rake db:migrate RAILS_ENV=production echo '- Assets Precompile' $BUNDLE exec rake assets:precompile RAILS_ENV=production echo '- Assets Sync' $BUNDLE exec rake assets:sync RAILS_ENV=production echo '- Create folder tmp' mkdir -p tmp/ echo '- Create file restart' touch tmp/restart.txt ``` $ chmod +x post-update # no servidor local git remote add production ssh://[email protected]/home/repo/site.git