mina-deploy / mina

Blazing fast deployer and server automation tool
https://rubygems.org/gems/mina
Other
4.36k stars 491 forks source link

Mina deploy failed with Rails and Vue? #659

Closed honglix closed 3 years ago

honglix commented 4 years ago

Screen Shot 2020-02-13 at 5 49 45 PM

How do I configure my deploy.rb?

task :deploy do
  deploy do
    comment "Deploying #{fetch(:application_name)} to #{fetch(:domain)}:#{fetch(:deploy_to)}"
    command %{ssh-agent}
    command %{rvm use 2.4}
    # command %{gem install bundler}
    invoke :'git:clone'
    invoke :'deploy:link_shared_paths'
    # invoke :'rvm:load_env_vars'
    invoke :'bundle:install'
    invoke :'rails:db_migrate'
    # command %{bundle exec rails db:migrate RAILS_ENV=production}
    # command %{#{fetch(:rails)} db:seed}
    command %{#{fetch(:rails)} webpacker:install:vue}
    invoke :'rails:assets_precompile'
    invoke :'deploy:cleanup'
von-christian commented 3 years ago

@honglix You can add this to your deploy.rb file

 command 'yarn' # Install package.json dependencies
 command "NODE_ENV=#{fetch(:rails_env)} RAILS_ENV=#{fetch(:rails_env)} bundle exec rails webpacker:compile" # Run this here so we aren't committing compiled assests to git
honglix commented 3 years ago

ok, thanks