Dématérialiser et simplifier les démarches administratives
Find a file
2018-01-18 10:53:34 +01:00
.circleci Set the RunRailsCops option in the rubocop config 2018-01-16 20:04:54 +01:00
app Enable the Layout/SpaceInsideBlockBraces cop 2018-01-18 10:53:34 +01:00
bin Don’t use unless 2018-01-12 11:32:43 +01:00
config Remove unreachable code 2018-01-18 10:32:39 +01:00
db Enable the Layout/SpaceAroundEqualsInParameterDefault cop 2018-01-18 10:53:34 +01:00
doc [fix #1000] export name and first name in api 2017-12-11 15:29:56 +01:00
lib Enable the Layout/SpaceAfterColon cop 2018-01-18 10:53:34 +01:00
log First Commit 2015-08-10 11:05:06 +02:00
public Fix features tests 2016-11-15 11:01:58 +01:00
spec Enable the Layout/SpaceInsideBlockBraces cop 2018-01-18 10:53:34 +01:00
vendor/assets Add map for gestionnaire 2017-09-06 11:11:28 +02:00
.editorconfig Add a .editorconfig file 2017-04-04 17:32:36 +02:00
.gitignore [Fix #1096] Github Oauth 2017-12-22 11:10:24 +01:00
.haml-lint.yml Detect implicit divs with haml-lint 2017-04-26 17:01:45 +02:00
.rspec First Commit 2015-08-10 11:05:06 +02:00
.rubocop.yml Enable the Layout/SpaceInsideBlockBraces cop 2018-01-18 10:53:34 +01:00
.ruby-version Use capybara-selenium with headless chrome 2018-01-16 14:02:10 +01:00
.scss-lint.yml Isolate new design stylesheets 2017-05-17 18:06:53 +02:00
config.ru Delete redis and actioncable 2017-10-12 07:21:02 +02:00
Gemfile Use an unreleased warden to avoid a devise error 2018-01-18 10:47:11 +01:00
Gemfile.lock Bump rest-client 2018-01-18 10:47:11 +01:00
Guardfile Enable the Layout/EmptyLines cop 2017-06-13 10:35:20 +02:00
LICENSE.agpl-3.0.txt Add license 2017-04-03 11:05:37 +02:00
Procfile Add a Procfile and document usage of hivemind 2018-01-02 11:20:22 +01:00
Rakefile Enable the Layout/EmptyLines cop 2017-06-13 10:35:20 +02:00
README.md Set the RunRailsCops option in the rubocop config 2018-01-16 20:04:54 +01:00

TPS - Téléprocédures Simplifiées

Context

Téléprocédures Simplifiées, ou TPS pour les intimes, est une plateforme 100 % web et 0 % email, conçue afin de répondre au besoin urgent de l'État d'appliquer la directive sur le 100 % démat' à l'horizon 2018 pour les procédures administratives.

Dépendances

Tous environnements

  • postgresql

Développement

Tests

Initialisation de l'environnement de développement

Afin d'initialiser l'environnement de développement, éxécutez la commande suivante :

bundle install

Création de la base de données

Les informations nécessaire à l'initialisation de la base doivent être pré-configurées à la main grâce à la procédure suivante :

su - postgres
psql
> create user tps_development with password 'tps_development' superuser;
> create user tps_test with password 'tps_test' superuser;
> \q

Afin de générer la BDD de l'application, il est nécessaire d'éxécuter les commandes suivantes :

# Create and load the schema for both databases
rake db:create db:schema:load

# Migrate the development database and then the test database
rake db:migrate
rake db:migrate RAILS_ENV=test

Bouchonnage de lauthentification

Créer le fichier config/france_connect.yml avec le contenu

particulier_identifier: ''
particulier_secret: ''

particulier_redirect_uri: ''
particulier_authorization_endpoint: ''
particulier_token_endpoint: ''
particulier_userinfo_endpoint: ''
particulier_logout_endpoint: ''

Créer le fichier config/github_secrets.yml avec le contenu

client_id: ''
client_secret: ''

Note : les valeurs pour ces deux paramètres sont renseignées dans le Keepass

Création des comptes initiaux

rails c
> email = "<votre email>"
> password = "<votre mot de passe>"
> Administration.create(email: email, password: password)
> Administrateur.create(email: email, password: password)
> Gestionnaire.create(email: email, password: password)
> User.create(email: email, password: password)

Lancement de l'application

hivemind

Programmation des jobs

AutoArchiveProcedureJob.set(cron: "* * * * *").perform_later
WeeklyOverviewJob.set(cron: "0 8 * * 0").perform_later
AutoReceiveDossiersForProcedureJob.set(cron: "* * * * *").perform_later(procedure_declaratoire_id, "received")
FindDubiousProceduresJob.set(cron: "0 0 * * *").perform_later

Exécution des tests (RSpec)

Pour exécuter les tests de l'application, plusieurs possibilités :

  • Lancer tous les tests

      rake spec
      rspec
    
  • Lancer un test en particulier

      rake spec SPEC=file_path/file_name_spec.rb:line_number
      rspec file_path/file_name_spec.rb:line_number
    
  • Lancer tous les tests d'un fichier

      rake spec SPEC=file_path/file_name_spec.rb
      rspec file_path/file_name_spec.rb
    

Linting

  • Faire tourner RuboCop : bundle exec rubocop
  • Faire tourner Brakeman : bundle exec brakeman -z
  • Linter les fichiers HAML : bundle exec haml-lint app/views/
  • Linter les fichiers SCSS : bundle exec scss-lint app/assets/stylesheets/

Déploiement

  • Tout nouveau commit ajouté à la branche dev est automatiquement déployé en intégration
  • Tout nouveau commit ajouté à la branche master est automatiquement déployé en production

Régénérer les binstubs

bundle binstub railties --force
rake rails:update:bin

Tâches Super Admin

  • ajouter un compte super admin : bundle exec rake admin:create_admin[email-du-compte-github@exemple.com]

  • lister les comptes super admin : bundle exec rake admin:list

  • supprimer un compte super admin : bundle exec rake admin:delete_admin[email-du-compte-github@exemple.com]