Commit 016bfb8f authored by Matthieu FAURE's avatar Matthieu FAURE
Browse files

DOC enhance doc

parent 4f35f8dd
# Fin d'installation de DS, étapes manuelles
# Last manual steps for installation of Démarches simplifiées
* Dans le dossier du projet `vagrant-demarches-simplifiees`, As a regular user:
## 1. Get into the box
```
vagrant box update
r10k puppetfile install -v
vagrant destroy -f && vagrant up
Once the vagrant box is build:
```shell script
vagrant ssh
```
* As user `vagrant`:
## 2. Run the install commands
```
```shell script
cd /home/vagrant/demarches-simplifiees.fr
sudo npm install -g npm-install-peers
sudo yarn install
......@@ -19,14 +18,16 @@ bundle install
bin/setup
```
Pour lancer le server :
```
ip a # liste les adresses IP de la machine
/home/vagrant/demarches-simplifiees.fr/bin/rails server --daemon --binding=<ip-de-la-Vm>
## 3. Define IP address and run server
```shell script
ip a # Lists IP addresses
/home/vagrant/demarches-simplifiees.fr/bin/rails server --daemon --binding=<IP-of-vagrant-box>
/home/vagrant/demarches-simplifiees.fr/bin/delayed_job run
```
En cas d'erreur des commandes précédentes :
```
......
......@@ -6,65 +6,46 @@ Vagrant box for Démarches Simplifiées
* Virtualbox
* Vagrant
* git
* r10k (see below how to do this properly)
## r10k installation on a workstation
TODO: this should be correctly explained and tested (which by now may not be the case :) )
1. On your workstation, install [RBenv](https://github.com/rbenv/rbenv). RBenv allows a user to have different versions of Ruby running on a system and isolate them. This is a great help when using Puppet on Linux, as Ruby versions shipped with distros can be quite old. Moreover, RBenv allows user to have a Ruby installation in its user-space, so that no root privileges are required.
1. With RBenv install Ruby 2.5.x (please follow RBenv documentation to do that)
1. Install r10k: `gem install r10k`
* Git
* a Ruby version management tool like RVM or [RBenv](https://github.com/rbenv/rbenv)
* r10k (`gem install r10k`)
## Usage
### For the first time : set a dev environnement
### 1. Grab source code of Démarches Simplifiées
Create a new project that is your local working development repository, for example:
```
```shell script
cd project
git clone https://github.com/adullact/demarches-simplifiees.fr.git
git clone git@github.com:betagouv/demarches-simplifiees.fr.git
```
Grab the vagrant-demarches-simplifiees repository, get into it, grab Puppet modules needed:
Note: you may clone your own fork of the source code (if you want to contribute for instance)
```
git clone git@gitlab.adullact.net:demarches-simplifiees/vagrant-demarches-simplifiees.git
cd vagrant-demarches-simplifiees
./BUILD.sh
```
### 2. Grab source code of vagrant-demarches-simplifiees
Edit the `Vagrantfile` config.vm.synced_folder parameter to match with your local working directory:
The first parameter is the relative path to the local project that you working on. For example here it's `../demarches-simplifiees.fr`
The second parameter is the path where it will be shared on the VM. `/shared_dev` as example.
```
config.vm.synced_folder "../demarches-simplifiees.fr", "/shared_dev"
```shell script
git clone git@gitlab.adullact.net:demarches-simplifiees/vagrant-demarches-simplifiees.git
```
Edit file 'manifests/default.pp'
Be sure that the variable `$local_source_code_of_ds` is the right one. If you haven't changed it, it's '/shared_dev/'.
### 3. Prepare the vagrant box
```
$local_source_code_of_ds = '/shared_dev/'
```shell script
cd vagrant-demarches-simplifiees
./BUILD.sh
```
Then run the vagrant file from the project directory:
### 4. Run the vagrant box
```
```shell script
vagrant up
```
Once the build is done, follow the instructions in [this document](Prerequisite_unautomated.md) to complete the installation.
### 5. Finish manual configuration
### To rebuild a vm
Complete the instructions from [Configuration_last_manual_steps](Configuration_last_manual_steps.md).
If you already have the all environment just run vagrant from the project directory:
### How to rebuild the vagrant box
```
```shell script
vagrant destroy -f && vagrant up
```
And follow the instructions in [this document](Prerequisite_unautomated.md).
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment