- We use
capistranofor deployments. - Currently hosted on AWS EC2 Tokyo region
- All applications run as
ruremauser.
- All applications run as
- Periodic tasks run in systemd timer (
systemctl list-timers)
- Debian 10 (buster)
apt install nginx groonga git bundler certbot
- passenger nginx module: https://www.phusionpassenger.com/docs/advanced_guides/install_and_upgrade/standalone/install/oss/buster.html
- rurema-search:
/var/rubydoc - docs.ruby-lang.org:
/var/www/docs.ruby-lang.org - nginx configuration:
/etc/nginx/sites-available/docs.ruby-lang.org
- old statically generated contents (old versions need to copy from old server):
/var/www/docs.ruby-lang.org/shared/public/{en,ja}/* - Fastly API Key:
/home/rurema/.docs-fastly - Slack webhook URL:
/etc/systemd/system/notify-to-slack.env
Usage:
git clone https://github.com/ruby/docs.ruby-lang.org git clone https://github.com/ruby/rurema-search cd docs.ruby-lang.org vagrant up vagrant ssh-config >> ~/.ssh/config bundle install cap vagrant deploy cp config/deploy/vagrant.rb ../rurema-search/config/deploy/vagrant.rb cd ../rurema-search cap vagrant deploy cd ../docs.ruby-lang.org vagrant ssh sudo systemctl start rdoc-static-all.service bc-setup-all.service & sudo systemctl status rdoc-static-all.service bc-setup-all.service bc-static-all.service update-rurema-index.service - Open
https://localhost:10443/in browser (ignore certificate error (NET::ERR_CERT_AUTHORITY_INVALID) because of using self signed certificate generated byprovision/selfsigned.yml) - Run
sudo systemctl start rdoc-static-all.serviceto update English documents. - Run
sudo systemctl start bc-setup-all.serviceto update Japanese documents. - Run
sudo systemctl status rdoc-static-all.service bc-setup-all.service bc-static-all.service update-rurema-index.serviceto see progress.Active: activating (start) since ...means running.Active: inactive (dead) since ...means finished.
cap production deploy ansible-playbook -i docs-2020, provision/playbook.yml ansible-playbook -i docs-2020, provision/users.yml ansible-playbook -i docs-2020, provision/rurema-search.yml ansible-playbook -i docs-2020, provision/letsencrypt.yml Install mackerel-check-plugins too.
Add/Modified:
[filesystems] ignore = "/dev/loop*" [plugin.checks.fileage-bc-setup-all] command = ["check-file-age", "-i", "-w", "90000", "-c", "172800", "-f", "/run/docs.ruby-lang.org/bc-setup-all.updated"] [plugin.checks.fileage-bc-static-all] command = ["check-file-age", "-i", "-w", "90000", "-c", "172800", "-f", "/run/docs.ruby-lang.org/bc-static-all.updated"] [plugin.checks.fileage-rdoc-static-all] command = ["check-file-age", "-i", "-w", "90000", "-c", "172800", "-f", "/run/docs.ruby-lang.org/rdoc-static-all.updated"] [plugin.checks.fileage-update-rurema-index] command = ["check-file-age", "-i", "-w", "90000", "-c", "172800", "-f", "/run/docs.ruby-lang.org/update-rurema-index.updated"]