Sha256: df012b86dcb59e9c2e98d2ac40aa5866fb4650eccaa2733f17831de4c91b1266

Contents?: true

Size: 1.38 KB

Versions: 54

Compression:

Stored size: 1.38 KB

Contents

# frozen_string_literal: true

require 'avm/stereotypes/eac_webapp_base0/deploy'

module Avm
  module Stereotypes
    module EacRailsBase0
      class Deploy < ::Avm::Stereotypes::EacWebappBase0::Deploy
        set_callback :assert_instance_branch, :after do
          bundle_install
          assert_database
          database_migrate
          compile_assets
          restart_tasks_scheduler
          touch_restart_file
        end

        def assert_database
          infom 'Asserting database...'
          instance.rake('db:create').system!
        end

        def bundle_install
          infom 'Running "bundle install"...'
          instance.bundle('install').system!
        end

        def compile_assets
          infom 'Compiling assets...'
          instance.rake('assets:clean', 'assets:precompile').system!
        end

        def database_migrate
          infom 'Running database migrations...'
          instance.rake('db:migrate').system!
        end

        def restart_tasks_scheduler
          infom 'Restarting Tasks Scheduler\'s daemon...'
          instance.bundle('exec', 'tasks_scheduler', 'restart').system!
        end

        def touch_restart_file
          infom 'Touching restart file...'
          instance.host_env.command(
            'touch', ::File.join(instance.read_entry(:fs_path), 'tmp', 'restart.txt')
          ).system!
        end
      end
    end
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
avm-tools-0.68.0 lib/avm/stereotypes/eac_rails_base0/deploy.rb
avm-tools-0.67.0 lib/avm/stereotypes/eac_rails_base0/deploy.rb
avm-tools-0.66.0 lib/avm/stereotypes/eac_rails_base0/deploy.rb
avm-tools-0.65.0 lib/avm/stereotypes/eac_rails_base0/deploy.rb
avm-tools-0.64.2 lib/avm/stereotypes/eac_rails_base0/deploy.rb
avm-tools-0.64.1 lib/avm/stereotypes/eac_rails_base0/deploy.rb
avm-tools-0.64.0 lib/avm/stereotypes/eac_rails_base0/deploy.rb
avm-tools-0.63.0 lib/avm/stereotypes/eac_rails_base0/deploy.rb
avm-tools-0.62.4 lib/avm/stereotypes/eac_rails_base0/deploy.rb
avm-tools-0.62.3 lib/avm/stereotypes/eac_rails_base0/deploy.rb
avm-tools-0.62.2 lib/avm/stereotypes/eac_rails_base0/deploy.rb
avm-tools-0.62.1 lib/avm/stereotypes/eac_rails_base0/deploy.rb
avm-tools-0.62.0 lib/avm/stereotypes/eac_rails_base0/deploy.rb
avm-tools-0.61.0 lib/avm/stereotypes/eac_rails_base0/deploy.rb
avm-tools-0.60.0 lib/avm/stereotypes/eac_rails_base0/deploy.rb
avm-tools-0.59.0 lib/avm/stereotypes/eac_rails_base0/deploy.rb
avm-tools-0.58.1 lib/avm/stereotypes/eac_rails_base0/deploy.rb
avm-tools-0.58.0 lib/avm/stereotypes/eac_rails_base0/deploy.rb
avm-tools-0.57.0 lib/avm/stereotypes/eac_rails_base0/deploy.rb
avm-tools-0.56.0 lib/avm/stereotypes/eac_rails_base0/deploy.rb