commit
1c65baf484
7 changed files with 33 additions and 0 deletions
2
Gemfile
2
Gemfile
|
@ -112,6 +112,8 @@ gem 'aasm'
|
|||
|
||||
gem 'webpacker', '>= 4.0.x'
|
||||
|
||||
gem 'after_party'
|
||||
|
||||
# Cron jobs
|
||||
gem 'delayed_job_active_record'
|
||||
gem "daemons"
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 :
|
||||
|
|
|
@ -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
|
||||
|
|
3
config/initializers/after_party.rb
Normal file
3
config/initializers/after_party.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
AfterParty.setup do |config|
|
||||
require "after_party/active_record.rb"
|
||||
end
|
7
db/migrate/20180718133126_create_task_records.rb
Normal file
7
db/migrate/20180718133126_create_task_records.rb
Normal 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
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue