README.md 2.27 KB
Newer Older
Matthieu FAURE's avatar
Matthieu FAURE committed
1
2
# Vagrant Démarches Simplifiées

Matthieu FAURE's avatar
Matthieu FAURE committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Vagrant box for Démarches Simplifiées

## Prerequisites

* 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`

## Usage

22
### For the first time : set a dev environnement
23

24
Create a new project that is your local working development repository, for example: 
25
26
27
28
29
30

```
cd project
git clone https://github.com/adullact/demarches-simplifiees.fr.git
```

31
Grab the vagrant-demarches-simplifiees repository, get into it, grab Puppet modules needed:
Matthieu FAURE's avatar
Matthieu FAURE committed
32
33
34
35
36
37

```
git clone git@gitlab.adullact.net:demarches-simplifiees/vagrant-demarches-simplifiees.git
cd vagrant-demarches-simplifiees
./BUILD.sh
```
38

39
Edit the `Vagrantfile` config.vm.synced_folder parameter to match with your local working directory:
40
41
42
 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.
 
43
```
44
config.vm.synced_folder "../demarches-simplifiees.fr", "/shared_dev"
45
46
```

47
Edit file 'manifests/default.pp'
48
49
Be sure that the variable `$local_source_code_of_ds` is the right one.  If you haven't changed it, it's '/shared_dev/'.

50
``` 
51
$local_source_code_of_ds = '/shared_dev/'
52
53
```

54
55
Then run the vagrant file from the project directory:

56
```
57
vagrant up
58
59
```

60
Once the build is done, follow the instructions in [this document](Prerequisite_unautomated.md) to complete the installation.
61

62
63
64
65
66
67
68
69
### To rebuild a vm 

If you already have the all environment just run vagrant from the project directory: 

```
vagrant destroy -f && vagrant up
```

70
And follow the instructions in [this document](Prerequisite_unautomated.md).