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

# Wait for Elasticsearch to start up
sleep 30

bundler install
yarn install --check-files
bundle exec rake tmp:create RAILS_ENV=${1:-development}
bundle exec rake tmp:cache:clear RAILS_ENV=${1:-development}
bundle exec rake webpacker:compile 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