-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ajoute la configuration scalingo pour la reviewapp
- Loading branch information
1 parent
ec6429a
commit 69dc577
Showing
4 changed files
with
98 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
bundle exec rails db:migrate | ||
bundle exec rails db:seed | ||
bundle exec rake reviewapp:seed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# frozen_string_literal: true | ||
|
||
COMPTES = { | ||
'[email protected]' => { prenom: 'super', nom: 'admin', role: 'superadmin' }, | ||
'[email protected]' => { prenom: 'admin', nom: 'admin', role: 'admin' }, | ||
'[email protected]' => { prenom: 'conseiller', nom: 'conseiller', role: 'conseiller' } | ||
}.freeze | ||
|
||
namespace :reviewapp do | ||
def cree_les_comptes(structure_eva) | ||
COMPTES.each do |email, data| | ||
Compte.where(email: email).first_or_create do |compte| | ||
compte.prenom = data[:prenom] | ||
compte.nom = data[:nom] | ||
compte.role = data[:role] | ||
compte.statut_validation = 'acceptee' | ||
compte.structure = structure_eva | ||
compte.password = 'bidon123456' | ||
end | ||
end | ||
end | ||
|
||
desc 'initialise les données pour les applications de revues' | ||
task seed: :environment do | ||
ParcoursType.find_or_create_by(nom_technique: 'litteratie_evacob') do |parcours_type| | ||
parcours_type.libelle = 'Parcours « compétences langagières (écrit) - ex-Evacob »' | ||
parcours_type.duree_moyenne = '30 minutes' | ||
parcours_type.categorie = 'evaluation_avancee' | ||
parcours_type.description = %(Ce parcours permet une évaluation fine des compétences\ | ||
langagières en matière d’écrit : lecture, identification et signalement de mots,\ | ||
compréhension de texte et écriture de mots.) | ||
situations = Situation.where(nom_technique: ['cafe_de_la_place']) | ||
parcours_type.situations_configurations_attributes = | ||
situations.map.with_index do |situation, index| | ||
{ situation_id: situation.id, position: index } | ||
end | ||
end | ||
|
||
structure_eva = Structure.where(nom: 'eva').first | ||
cree_les_comptes structure_eva | ||
|
||
Compte.all.each do |compte| | ||
compte.encrypted_password = '$2a$11$d.kf40n..7zqTGgCPANFlOiLvwGH35EPh0OsY6euJaje3Us20KIWO' | ||
compte.save!(validate: false) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"env": { | ||
"HOTE_SERVEUR": { | ||
"generator": "template", | ||
"template" : "%APP%.osc-fr1.scalingo.io" | ||
} | ||
}, | ||
"scripts": { | ||
"first-deploy": "bin/reviewappdeploy.sh" | ||
} | ||
} |