aboutsummaryrefslogtreecommitdiff
blob: 63130ed7a3d2f3a1233f613aeae72f30977f9a94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

# Wait for Elasticsearch to start up
sleep 30

bundler install
bundle exec rake tmp:create RAILS_ENV=${1:-development}
bundle exec rake assets:precompile RAILS_ENV=${1:-development}
bundle exec rake kkuleomi:index:init RAILS_ENV=${1:-development}
./bin/update-all.sh ${1:-development}

if [[ "${1:-development}" == "production" ]]
then
  crontab -l | { cat; echo "*/10 * * * * /var/www/packages.gentoo.org/htdocs/bin/update-all.sh ${1:-development}"; } | crontab -
fi

# Finally start the http server when the index is initialized
bundle exec thin start -p 5000