From a3a589fee893f4b29605b394346f4501b0679e0d Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 12 Jan 2016 14:32:47 -0400 Subject: [PATCH] Update Vagrantfile to provision a production box too. --- HISTORY.rst | 1 + Vagrantfile | 35 ++++++++++++++++++++++++++++------- docs/releases/2.0.1.rst | 12 ++++++++++++ docs/topics/deploying.rst | 9 +++++++++ docs/topics/development.rst | 2 +- 5 files changed, 51 insertions(+), 8 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 043036c407..3dff3b0cd5 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,6 +2,7 @@ ================== - Fix GitLab issue #243, "System allows a user to skip entering values for a required metadata field while uploading a new document" - Fix GitLab issue #245, "Add multiple metadata not possible" +- Updated Vagrantfile to provision a production box too. 2.0 (2015-12-04) ================ diff --git a/Vagrantfile b/Vagrantfile index 8046e9ac64..b4fcc73eb2 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,12 +1,33 @@ # -*- mode: ruby -*- # vi: set ft=ruby : -Vagrant.configure(2) do |config| - config.vm.box = "ubuntu/trusty32" - config.vm.network "forwarded_port", guest: 8000, host: 8000 - config.vm.synced_folder ".", "/mayan-edms-repository" - config.vm.provision :shell, :path => "contrib/scripts/install/development.sh", privileged: false +VAGRANTFILE_API_VERSION = "2" + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + config.vm.box = "ubuntu/trusty64" + + config.vm.provider :lxc do |v, override| + override.vm.box = "fgrehm/trusty64-lxc" + end + + config.vm.provider :virtualbox do |vb| + vb.customize ["modifyvm", :id, "--memory", "1024"] + end + + # Development box + config.vm.define "development", autostart: false do |development| + development.vm.network "forwarded_port", guest: 8000, host: 8000 + development.vm.synced_folder ".", "/mayan-edms-repository" + development.vm.provision :shell, :path => "contrib/scripts/install/development.sh", privileged: false + + development.vm.provision "file", destination: "/home/vagrant/mayan-edms/mayan/settings/celery_redis.py", source: "contrib/settings/celery_redis.py" + development.vm.provision "file", destination: "/home/vagrant/mayan-edms/mayan_edms_worker.sh", source: "contrib/misc/mayan_edms_worker.sh" + end + + # Production box + config.vm.define "production", autostart: false do |production| + production.vm.network "forwarded_port", guest: 80, host: 8080 + production.vm.provision :shell, :path => "contrib/scripts/install/production.sh", privileged: true + end - config.vm.provision "file", destination: "/home/vagrant/mayan-edms/mayan/settings/celery_redis.py", source: "contrib/settings/celery_redis.py" - config.vm.provision "file", destination: "/home/vagrant/mayan-edms/mayan_edms_worker.sh", source: "contrib/misc/mayan_edms_worker.sh" end diff --git a/docs/releases/2.0.1.rst b/docs/releases/2.0.1.rst index ab64389d7b..0e25e7f3f9 100644 --- a/docs/releases/2.0.1.rst +++ b/docs/releases/2.0.1.rst @@ -24,6 +24,18 @@ Fix multiple document metadata editing Fixed a bug that made it impossible to edit multiple documents' metadata values if one of the documents had no previous value for it's metadata. +Updated Vagrant file +-------------------- +The included Vagrant file now provide 2 boxes: development and production. +Selection which kind of box to provision is as easy as executing:: + + vagrant up development + +or + + vagrant up production + + Other changes ------------- * None diff --git a/docs/topics/deploying.rst b/docs/topics/deploying.rst index 89ff985578..b03c9b461b 100644 --- a/docs/topics/deploying.rst +++ b/docs/topics/deploying.rst @@ -247,3 +247,12 @@ be available by browsing to http://127.0.0.1. You can inspect the initialization with:: docker logs mayanedms_mayan-edms_1 + +Vagrant +======= +Make sure you have Vagrant and a provider properly installed as per +https://docs.vagrantup.com/v2/installation/index.html +And execute:: + + vagrant up production + diff --git a/docs/topics/development.rst b/docs/topics/development.rst index 977a4b2358..abbbb11d89 100644 --- a/docs/topics/development.rst +++ b/docs/topics/development.rst @@ -254,7 +254,7 @@ Start and provision a machine using: .. code-block:: bash - vagrant up + vagrant up development To launch a standalone development server ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~