Merge pull request #2483 from tchak/after_party

Add after_party
This commit is contained in:
Paul Chavard 2018-08-30 12:11:14 +01:00 committed by GitHub
commit 1c65baf484
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 33 additions and 0 deletions

View file

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

View file

@ -88,6 +88,7 @@ GEM
sass-rails (~> 5.0)
selectize-rails (~> 0.6)
aes_key_wrap (1.0.1)
after_party (1.10.0)
apipie-rails (0.5.10)
rails (>= 4.1)
arel (9.0.0)
@ -806,6 +807,7 @@ DEPENDENCIES
active_link_to
active_model_serializers
administrate
after_party
apipie-rails
bootstrap-sass (~> 3.3.5)
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/rspec file_path/file_name_spec.rb
## Ajout de taches à exécuter au déploiement
rails generate after_party:task task_name
## 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 :

View file

@ -110,6 +110,16 @@ namespace :yarn do
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."
task :deploy => :environment do
queue 'export PATH=$PATH:/usr/local/rbenv/bin:/usr/local/rbenv/shims'
@ -122,6 +132,7 @@ task :deploy => :environment do
invoke :'bundle:install'
invoke :'yarn:install'
invoke :'rails:db_migrate'
invoke :'rails:after_party'
invoke :'rails:assets_precompile:force'
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"
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|
t.string "libelle"
t.string "type_champ"