Skip to content

nissyi-gh/docs.ruby-lang.org

Repository files navigation

docs.ruby-lang.org

Platform Environment

  • We use capistrano for deployments.
  • Currently hosted on AWS EC2 Tokyo region
    • All applications run as rurema user.
  • Periodic tasks run in systemd timer (systemctl list-timers)

Requisites

Files and Directories

  • rurema-search: /var/rubydoc
  • docs.ruby-lang.org: /var/www/docs.ruby-lang.org
  • nginx configuration: /etc/nginx/sites-available/docs.ruby-lang.org

Files need to backup

  • 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

Related repos

Vagrant Environment

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 by provision/selfsigned.yml)
  • Run sudo systemctl start rdoc-static-all.service to update English documents.
  • Run sudo systemctl start bc-setup-all.service to update Japanese documents.
  • Run sudo systemctl status rdoc-static-all.service bc-setup-all.service bc-static-all.service update-rurema-index.service to see progress.
    • Active: activating (start) since ... means running.
    • Active: inactive (dead) since ... means finished.

Production Environment

Capstrano

cap production deploy 

ansible

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 

/etc/mackerel-agent/mackerel-agent.conf

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"] 

About

Source of the docs.ruby-lang.org site

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby60.8%
  • HTML25.2%
  • Shell14.0%