Commit baa4c028 authored by Fabrice Gangler's avatar Fabrice Gangler 🎨
Browse files

REFACTOR: release v3.0.0 (rename VM, database name, database user, ...)

parent 990c46d7
......@@ -6,14 +6,32 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## v2.0.1
## v3.0.0, 2020.11.26
### Fixed
- #25 - Vagrant user can use psql easily
- Improve helping message to show after vagrant up
### Changed
- Change VM name (`DEV_demarches-simplifiees` instead off `DemarchesSimplifiees`)
- Change database user/role/password and database name
- Rename source directory (`./src/` instead off `./demarches-simplifiees.fr/`)
### Removed
- Remove unnecessary prerequisite Tmux
## v2.0.1, 2020.11.02
### Fixed
- #19 - Update ruby verion (2.7.1 instead off 2.6.5)
## v2.0.0
## v2.0.0, 2020.08.04
### Changed
......@@ -22,10 +40,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Add helping message to show after vagrant up
- add CODE_OF_CONDUCT file
- add CHANGELOG file
- Add CODE_OF_CONDUCT file
- Add CHANGELOG file
## v1.0.0
## v1.0.0, 2020.08.02
First release
......@@ -15,3 +15,21 @@ Vagrant box for Démarches Simplifiées (DS)
see: [Documentation - DevOps/developer/vagrant](https://gitlab.adullact.net/demarches-simplifiees/demarches-simplifiees-documentation/-/tree/main/DevOps/developer/vagrant)
### Temporary documentation
Temporary documentation to access the database <br>
from an IDE (pending the use of Puppet to do this):
- database URL: `jdbc:postgresql://localhost:5439/vagrant`
- database user: `vagrant`
- database password: `database1Password`
```
vagrant ssh -c 'sudo su'
ETC_PG_DIRECTORY="/etc/postgresql/10/main"
sed -i -e "s/listen_addresses = 'localhost'/listen_addresses = '*'/" "${ETC_PG_DIRECTORY}/postgresql.conf"
sed -i -e "s/#listen_addresses = /listen_addresses = /" "${ETC_PG_DIRECTORY}/postgresql.conf"
echo "host all all 10.0.2.2/32 md5" >>"${ETC_PG_DIRECTORY}/pg_hba.conf"
service postgresql restart
```
\ No newline at end of file
......@@ -4,6 +4,7 @@ if [ ! -f /opt/puppetlabs/bin/puppet ]; then
sudo dpkg -i puppet5-release-bionic.deb
sudo apt-get update
sudo apt-get install puppet-agent
sudo rm puppet5-release-bionic.deb
fi
SCRIPT
......@@ -11,15 +12,13 @@ Vagrant.configure("2") do |config|
config.vm.define "ds" do |ds|
config.vm.synced_folder "../demarches-simplifiees.fr", "/shared_dev"
ds.vm.provider "virtualbox" do |vb|
vb.name = "DemarchesSimplifiees "
vb.name = "DEV_demarches-simplifiees"
vb.memory = "4096"
vb.cpus = "4"
end
ds.vm.box = "ubuntu/bionic64"
ds.vm.network "forwarded_port", id: 'PumaServer', guest: 3000, host: 3000, auto_correct: true, host_ip: "127.0.0.1"
ds.vm.network "forwarded_port", id: 'PostgreSQL', guest: 5432, host: 5439, auto_correct: true, host_ip: "127.0.0.1"
# ds.vm.network "forwarded_port", id: 'WebProxy', guest: 80, host: 8080, auto_correct: true, host_ip: "127.0.0.1"
# ds.vm.network "forwarded_port", id: 'MailHogGUI', guest: 8025, host: 8025, auto_correct: true, host_ip: "127.0.0.1"
ds.vm.hostname = "ds.example.org"
ds.vm.provision "shell", inline: $script_bionic
ds.vm.provision "puppet" do |ds1|
......@@ -33,36 +32,57 @@ Vagrant.configure("2") do |config|
###############################################################################################
###############################################################################################
config.vm.post_up_message = <<-MESSAGE
------------------------------------------------
/!\\ Created for test purposes only,
not to be used in production
------------------------------------------------
--------------------------------------------------------------
/!\\ Created for testing purpose only,
no security has been made for production
--------------------------------------------------------------
# To see application log
vagrant ssh -c 'tail -f demarches-simplifiees.fr/log/development.log'
# LOG - To see application log
vagrant ssh -c 'cd src; tail -f log/development.log'
# To see .env file
vagrant ssh -c 'cd demarches-simplifiees.fr; cat .env'
# CONFIG - To see application configuration (environment name, schema version, Ruby/Rails version)
vagrant ssh -c 'cd src; bin/rake about'
# To see application configuration (environment name, schema version, Ruby/Rails version)
vagrant ssh -c 'cd demarches-simplifiees.fr; bin/rake about'
# CONFIG - To see .env file
vagrant ssh -c 'cd src; cat .env'
# Update dependencies and database (useful if you have updated the DS repository)
vagrant ssh -c 'cd demarches-simplifiees.fr; bin/update'
--------------------------------------------------------------
# TEST - Before running ruby tests
vagrant ssh -c 'sudo -u postgres psql -c "ALTER USER tps_test WITH SUPERUSER;"'
# Finalize installation (1)
vagrant ssh -c 'cd demarches-simplifiees.fr; bin/setup'
# TEST - Run all ruby tests (spec files)
vagrant ssh -c 'cd src; bin/rspec'
# Start server to be able to restart it quickly (use Ctrl-C to stop it)
vagrant ssh -c 'cd demarches-simplifiees.fr; RAILS_QUEUE_ADAPTER=delayed_job; bin/rails server --binding=0.0.0.0'
--------------------------------------------------------------
------------------------------------------------
# LINT - Run all Linters (RuboCop, HAML-Lint, SCSS-Lint, ESLint, HAML-Lint)
vagrant ssh -c 'cd src; bin/rake lint'
# DATABASE - Launch PostgreSQL interactive terminal
vagrant ssh -c 'psql'
--------------------------------------------------------------
# UPDATE - Update dependencies and database (useful if you have updated the DS repository)
vagrant ssh -c 'cd src; bin/update'
# INSTALL - Finalize installation (1)
vagrant ssh -c 'cd src; bin/setup'
# PUMA - Start server to be able to restart it quickly (use Ctrl-C to stop it)
vagrant ssh -c 'cd src; RAILS_QUEUE_ADAPTER=delayed_job; bin/rails server --binding=0.0.0.0'
--------------------------------------------------------------
Use 'vagrant port' command line to see port mapping.
Default : 3000 (guest) --> 3000 (host) Puma server port
------------------------------------------------
--------------------------------------------------------------
URL webmail ... http://localhost:3000/letter_opener (default)
URL webapp .... http://localhost:3000 (default) ---> fisrt run: see (1)
------------------------------------------------
--------------------------------------------------------------
User .......... test@exemple.fr
Password ...... this is a very complicated password !
--------------------------------------------------------------
MESSAGE
###############################################################################################
###############################################################################################
......
......@@ -37,13 +37,13 @@
# System user for Démarches Simplifiées
$_system_username = 'vagrant'
$_ds_home = "/home/${_system_username}"
$_ds_project_directory = "$_ds_home/demarches-simplifiees.fr"
$db_user_name = 'ds'
$db_name = 'ds'
$_ds_db_role = 'ds'
$db_user_password = 'kiki34' # /!\ Do not forget to change this passwd in production :)
$_ds_project_directory = "$_ds_home/src"
$db_user_name = 'vagrant'
$db_name = 'vagrant'
$_ds_db_role = 'vagrant'
$db_user_password = 'database1Password' # /!\ Do not forget to change this passwd in production :)
$db_host = 'localhost'
$db_port = 3434
$db_port = 5432
$db_test_name = 'tps_test'
$db_test_user_name = 'tps_test'
$db_test_user_password = 'tps_test'
......@@ -51,7 +51,7 @@ $_ds_db_test_role = 'test'
#$source_code_of_ds = 'https://github.com/betagouv/demarches-simplifiees.fr.git'
$local_source_code_of_ds = '/shared_dev/'
$_path_bundle = "$_ds_home/rbenv/shims/"
$db_database = 'ds'
$db_database = 'vagrant'
$db_pool = ''
# #############################################################################
......@@ -218,7 +218,3 @@ class { 'nodejs':
# /!\ By default, last version is installed
class { 'yarn': }
# #############################################################################
# PREREQUISITES tmux
# Install tmux
class { 'tmux': }
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