Dématérialiser et simplifier les démarches administratives
Find a file
Mathieu Magnin 6de26e79e6 Merge pull request #755 from sgmap/fix_sentry_issue_tps_dev_1833
If type de champ has no dropdownlist do not crash
2017-09-22 14:29:56 +02:00
.circleci CircleCi: increase to 3 parallel workers 2017-07-21 14:24:34 +02:00
app If type de champ has no dropdownlist do not crash, (sentry issue: https://sentry.apientreprise.fr/apientreprise/tps_dev/issues/1833/) 2017-09-22 14:16:00 +02:00
bin [Ref #288] Remove /bin from .gitignore, add binstubs 2017-05-12 17:40:22 +02:00
config Avis instruction: can ask for a confidentiel avis 2017-09-20 15:42:26 +02:00
db Avis: add confidentiel field 2017-09-20 15:42:26 +02:00
doc [Ref #145] Don't use Procedure.archived anymore 2017-07-11 15:03:35 +02:00
lib Avis: add confidentiel field 2017-09-20 15:42:26 +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 #719] Unformat date and yes/no values in the form 2017-09-20 17:40:43 +02: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 Bootstrap Action Cable and Unicorn 2016-12-22 21:49:31 +01:00
Gemfile Add Kaminari gem for pagination 2017-09-22 10:19:25 +02:00
Gemfile.lock Add Kaminari gem for pagination 2017-09-22 10:19:25 +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 [Ref #288] Remove the seeds.rb file which required an uncommitted file 2017-08-25 15:34:30 +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
  • redis

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

redis-server
sidekiq
mailcatcher -f
rails s

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