From e8a252269a27a59e9b4c4af44211b69fd7eed08f Mon Sep 17 00:00:00 2001 From: Pablo Brasero Date: Thu, 9 Oct 2025 11:12:34 +0100 Subject: [PATCH] Remove support for development environment with Vagrant --- INSTALL.md | 7 ++--- VAGRANT.md | 48 ------------------------------- Vagrantfile | 44 ---------------------------- script/vagrant/setup/provision.sh | 44 ---------------------------- 4 files changed, 2 insertions(+), 141 deletions(-) delete mode 100644 VAGRANT.md delete mode 100644 Vagrantfile delete mode 100644 script/vagrant/setup/provision.sh diff --git a/INSTALL.md b/INSTALL.md index 7c7e4e0b6..69c500429 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -8,10 +8,7 @@ You can setup development enviroment by: ### Containerized Installation -These options provide consistent development environments and may avoid installation difficulties: - -* **🐳 Docker** - Uses containerization. See [DOCKER.md](DOCKER.md) for complete instructions. -* **📦 Vagrant** - Installs in a virtual machine. See [VAGRANT.md](VAGRANT.md) for complete instructions. +We also offer a containerized environment with Docker which may avoid installation difficulties. See [DOCKER.md](DOCKER.md) for complete instructions. ### Manual Installation @@ -22,7 +19,7 @@ Install dependencies directly on your machine (traditional approach, covered in **Platform Support:** These instructions are based on Ubuntu 24.04 LTS, though the OSMF servers are currently running Debian 12. The instructions also work, with only minor amendments, for all other current Ubuntu releases, Fedora and macOS. > [!WARNING] -> **Windows Note:** We don't recommend using this approach for development and deployment on Windows. Some Ruby gems may not be supported. If you are using Windows, we recommend containerized setup using [Docker](DOCKER.md)(preferred) or [Vagrant](VAGRANT.md). +> **Windows Note:** We don't recommend using this approach for development and deployment on Windows. Some Ruby gems may not be supported. If you are using Windows, we recommend containerized setup using [Docker](DOCKER.md). ## Manual Installation Guide diff --git a/VAGRANT.md b/VAGRANT.md deleted file mode 100644 index ed84eed57..000000000 --- a/VAGRANT.md +++ /dev/null @@ -1,48 +0,0 @@ -# Installing Vagrant - -On Ubuntu, it should be as simple as: - -``` -sudo apt-get install vagrant -``` - -Other Linux distributions should have similar installation instructions using `dnf`, `pacman`, or similar. - -Installers are available for Mac OS X and Windows, please see the [Vagrant project download page](https://www.vagrantup.com/downloads.html) for more information. - -We currently support three Vagrant providers, namely `virtualbox`, `lxc` and `libvirt`. You might need to install one of these, for example virtualbox, and specify the provider, e.g. `--provider virtualbox`, when setting up your environment. - -# Setting up openstreetmap-website - -Once Vagrant has been installed, you can start an environment by checking out the openstreetmap-website code if you haven't already, then changing to the directory which contains the Vagrantfile by typing: - -``` -git clone git@github.com:openstreetmap/openstreetmap-website.git -cd openstreetmap-website -vagrant up -``` - -This will take a few minutes to download required software from the internet and set it up as a running system. Once it is complete, you should be able to log into the running VM by typing: - -``` -vagrant ssh -``` - -Within this login shell, you can do development, run the server or the tests. For example, to run the tests: - -``` -cd /srv/openstreetmap-website/ -bundle exec rails test:all -``` - -To access the web pages you run the following commands then access the site in your [local browser](http://localhost:3000): - -``` -vagrant ssh -cd /srv/openstreetmap-website/ -bundle exec rails server --binding=0.0.0.0 -``` - -You edit the code on your computer using the code editor you are used to using, then through shared folders the code is updated on the VM instantly. - -You should run the tests before submitting any patch or Pull Request back to the original repository. Please see [CONTRIBUTING.md](CONTRIBUTING.md) for more information. diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index f5abc66b2..000000000 --- a/Vagrantfile +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure("2") do |config| - # use official debian image - config.vm.box = "debian/bookworm64" - - # configure virtualbox provider - config.vm.provider "virtualbox" do |vb, override| - override.vm.synced_folder ".", "/srv/openstreetmap-website" - vb.customize ["modifyvm", :id, "--memory", "4096"] - vb.customize ["modifyvm", :id, "--cpus", "2"] - vb.customize ["modifyvm", :id, "--uartmode1", "disconnected"] - end - - # Use sshfs sharing if available, otherwise NFS sharing - sharing_type = Vagrant.has_plugin?("vagrant-sshfs") ? "sshfs" : "nfs" - - # configure lxc provider - config.vm.provider "lxc" do |_, override| - override.vm.synced_folder ".", "/srv/openstreetmap-website", :type => sharing_type - end - - # configure libvirt provider - config.vm.provider "libvirt" do |libvirt, override| - override.vm.synced_folder ".", "/srv/openstreetmap-website", :type => sharing_type - libvirt.memory = 4096 - libvirt.cpus = 2 - end - - # configure shared package cache if possible - if Vagrant.has_plugin?("vagrant-cachier") - config.cache.enable :apt - config.cache.scope = :box - end - - # port forward for webrick on 3000 - config.vm.network :forwarded_port, :guest => 3000, :host => 3000 - - # provision using a simple shell script - config.vm.provision :shell, :path => "script/vagrant/setup/provision.sh" -end diff --git a/script/vagrant/setup/provision.sh b/script/vagrant/setup/provision.sh deleted file mode 100644 index f6ecd4ed5..000000000 --- a/script/vagrant/setup/provision.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash - -# abort on error -set -e - -# make sure we have up-to-date packages -apt-get update - -# upgrade all packages -apt-get upgrade -y - -# install packages as explained in INSTALL.md -apt-get install -y ruby ruby-dev ruby-bundler \ - libxml2-dev libxslt1-dev nodejs npm \ - build-essential git-core firefox-esr \ - postgresql postgresql-contrib libpq-dev libvips-dev libyaml-dev \ - libsasl2-dev libffi-dev libgd-dev libarchive-dev libbz2-dev -npm install --global yarn - -## install the bundle necessary for openstreetmap-website -pushd /srv/openstreetmap-website -# do bundle install as a convenience -bundle install --retry=10 --jobs=2 -# do yarn install as a convenience -bundle exec bin/yarn install -# create user and database for openstreetmap-website -db_user_exists=`sudo -u postgres psql postgres -tAc "select 1 from pg_roles where rolname='vagrant'"` -if [ "$db_user_exists" != "1" ]; then - sudo -u postgres createuser -s vagrant -fi - -# set up sample configs -if [ ! -f config/database.yml ]; then - sudo -u vagrant cp config/example.database.yml config/database.yml -fi -if [ ! -f config/storage.yml ]; then - cp config/example.storage.yml config/storage.yml -fi -touch config/settings.local.yml -# create the databases -sudo -u vagrant bundle exec rails db:create -# migrate the database to the latest version -sudo -u vagrant bundle exec rails db:migrate -popd -- 2.39.5