Dématérialiser et simplifier les démarches administratives
Find a file
2017-10-30 14:19:20 +01:00
.circleci Use the i386 cache template key : https://discuss.circleci.com/t/use-the-arch-cache-template-key-if-you-rely-on-cached-compiled-binary-dependencies/16129 2017-10-02 18:10:25 +02:00
app [Fix #925] strip avis email input 2017-10-30 14:19:20 +01:00
bin Add and install delayed_job gem 2017-09-27 16:47:32 +02:00
config Increase the timeout to 60 seconds 2017-10-17 12:31:44 +02:00
db AttestationTemplate: store logo and signature with uuid 2017-10-19 15:32:04 +02:00
doc Add initiated_at to DossiersSerializer 2017-10-06 17:49:06 +02:00
lib Rake: task to regenerate the attestation 2017-10-19 15:40:52 +02: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 [Fix #925] strip avis email input 2017-10-30 14:19:20 +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 [Ref #288] Remove /bin from .gitignore, add binstubs 2017-05-12 17:40:22 +02: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 Rubocop: enable Layout/SpaceAroundOperators 2017-08-28 13:39:13 +02:00
.ruby-version Migrate to ruby 2.3.1 2016-11-07 11:23:21 +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 Delete redis and actioncable 2017-10-12 07:21:02 +02:00
Gemfile.lock Delete redis and actioncable 2017-10-12 07:21:02 +02: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
Rakefile Enable the Layout/EmptyLines cop 2017-06-13 10:35:20 +02:00
README.md Add command to create a procedure declaratoire POC 2017-10-06 17:49:31 +02: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

  • Mailcatcher : gem install mailcatcher

Tests

  • PhantomJS

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

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

bin/delayed_job run
mailcatcher -f
rails s

Programmation des jobs

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

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 -R
  • 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