Add after_party

This commit is contained in:
Paul Chavard 2018-07-18 15:45:23 +02:00
parent 5339ee43f5
commit c67f8dcaaa
7 changed files with 33 additions and 0 deletions

View file

@ -112,6 +112,8 @@ gem 'aasm'
gem 'webpacker', '>= 4.0.x' gem 'webpacker', '>= 4.0.x'
gem 'after_party'
# Cron jobs # Cron jobs
gem 'delayed_job_active_record' gem 'delayed_job_active_record'
gem "daemons" gem "daemons"

View file

@ -88,6 +88,7 @@ GEM
sass-rails (~> 5.0) sass-rails (~> 5.0)
selectize-rails (~> 0.6) selectize-rails (~> 0.6)
aes_key_wrap (1.0.1) aes_key_wrap (1.0.1)
after_party (1.10.0)
apipie-rails (0.5.10) apipie-rails (0.5.10)
rails (>= 4.1) rails (>= 4.1)
arel (9.0.0) arel (9.0.0)
@ -806,6 +807,7 @@ DEPENDENCIES
active_link_to active_link_to
active_model_serializers active_model_serializers
administrate administrate
after_party
apipie-rails apipie-rails
bootstrap-sass (~> 3.3.5) bootstrap-sass (~> 3.3.5)
bootstrap-wysihtml5-rails (~> 0.3.3.8) bootstrap-wysihtml5-rails (~> 0.3.3.8)

View file

@ -91,6 +91,10 @@ Pour exécuter les tests de l'application, plusieurs possibilités :
bin/rake spec SPEC=file_path/file_name_spec.rb bin/rake spec SPEC=file_path/file_name_spec.rb
bin/rspec file_path/file_name_spec.rb bin/rspec file_path/file_name_spec.rb
## Ajout de taches à exécuter au déploiement
rails generate after_party:task task_name
## Debug ## Debug
Une fois `overmind` lancé, et un breakpoint `byebug` inséré dans le code, il faut se connecter au process `server` dans un nouveau terminal afin d'intéragir avec byebug : Une fois `overmind` lancé, et un breakpoint `byebug` inséré dans le code, il faut se connecter au process `server` dans un nouveau terminal afin d'intéragir avec byebug :

View file

@ -110,6 +110,16 @@ namespace :yarn do
end end
end end
namespace :rails do
desc "Run deploy tasks."
task :after_party do
queue %{
echo "-----> Running deploy tasks"
#{echo_cmd %[bin/rake after_party:run]}
}
end
end
desc "Deploys the current version to the server." desc "Deploys the current version to the server."
task :deploy => :environment do task :deploy => :environment do
queue 'export PATH=$PATH:/usr/local/rbenv/bin:/usr/local/rbenv/shims' queue 'export PATH=$PATH:/usr/local/rbenv/bin:/usr/local/rbenv/shims'
@ -122,6 +132,7 @@ task :deploy => :environment do
invoke :'bundle:install' invoke :'bundle:install'
invoke :'yarn:install' invoke :'yarn:install'
invoke :'rails:db_migrate' invoke :'rails:db_migrate'
invoke :'rails:after_party'
invoke :'rails:assets_precompile:force' invoke :'rails:assets_precompile:force'
to :launch do to :launch do

View file

@ -0,0 +1,3 @@
AfterParty.setup do |config|
require "after_party/active_record.rb"
end

View file

@ -0,0 +1,7 @@
class CreateTaskRecords < ActiveRecord::Migration[5.2]
def change
create_table :task_records, id: false do |t|
t.string :version, null: false
end
end
end

View file

@ -548,6 +548,10 @@ ActiveRecord::Schema.define(version: 2018_08_27_111451) do
t.index ["administrateur_id"], name: "index_services_on_administrateur_id" t.index ["administrateur_id"], name: "index_services_on_administrateur_id"
end end
create_table "task_records", id: false, force: :cascade do |t|
t.string "version", null: false
end
create_table "types_de_champ", id: :serial, force: :cascade do |t| create_table "types_de_champ", id: :serial, force: :cascade do |t|
t.string "libelle" t.string "libelle"
t.string "type_champ" t.string "type_champ"