Skip to content

Commit

Permalink
Store post-receive script + Fix zammad#1
Browse files Browse the repository at this point in the history
  • Loading branch information
m0g committed Oct 3, 2018
1 parent 45e416b commit a90132d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions script/post-receive
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
export RAILS_ENV=production
git --work-tree=/opt/zammad --git-dir=/home/ubuntu/zammad.git checkout -f
cd /opt/zammad
/home/ubuntu/.rvm/gems/ruby-2.4.4/wrappers/bundle install --without test development mysql

# Enable memcached
sed -i -e "s/.*config.cache_store.*file_store.*cache_file_store.*/ config.cache_store = :dalli_store, '127.0.0.1:11211'\n config.session_store = :dalli_store, '127.0.0.1:11211'/" config/application.rb


/home/ubuntu/.rvm/gems/ruby-2.4.4/wrappers/rake db:migrate
/home/ubuntu/.rvm/gems/ruby-2.4.4/wrappers/rake assets:clean
/home/ubuntu/.rvm/gems/ruby-2.4.4/wrappers/rake assets:precompile

# delete assets precompile cache
rm -r tmp/cache

# create es searchindex
/home/ubuntu/.rvm/gems/ruby-2.4.4/wrappers/bundle exec rails r "Setting.set('es_url', 'http://localhost:9200')"
/home/ubuntu/.rvm/gems/ruby-2.4.4/wrappers/bundle exec rake searchindex:rebuild

0 comments on commit a90132d

Please sign in to comment.