Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'deploy' deploys twice #28

Open
samnissen opened this issue Dec 19, 2017 · 1 comment
Open

'deploy' deploys twice #28

samnissen opened this issue Dec 19, 2017 · 1 comment

Comments

@samnissen
Copy link

From config/deploy.rb

require 'mina/multistage'
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rvm'

set :rvm_path, '$HOME/.rvm/bin/rvm'

task :remote_environment do
  invoke :'rvm:use', 'ruby-2.4'
end

task :'db:configure' do
  invoke :'rails:db_create'
  invoke :'rails:db_migrate'
  command "#{fetch(:rails)} db:seed"
end

From config/deploy/production.rb

set :domain, ENV['SOMEENVNAME']
set :deploy_to, ENV['SOMEOTHERENV']
set :repository, '[email protected]:name/codebase.git'
set :branch, 'master'
set :term_mode, nil
set :rails_env, 'production'

task :deploy => :environment do
  deploy do
    invoke :'git:clone'
    invoke :'deploy:link_shared_paths'
    invoke :'bundle:install'
    invoke :'db:configure'
    invoke :'rails:assets_precompile'
    invoke :'deploy:cleanup'
    command %[sudo /bin/systemctl restart httpd.service]
  end
end

Running the appropriate setup steps and then mina production deploy (or staging, omitted for simplicity), produces

# ...
-----> Moving build to /path/to/deployment/releases/1
-----> Build finished
-----> Launching
       Connection to 1.2.3.4 closed.

-----> Updating the /path/to/deployment/current symlink
-----> Done. Deployed version 1
       Elapsed time: 206.62 seconds
-----> Creating a temporary build path # <= starting on version 2
-----> Using RVM environment "ruby-2.4"
       Using /home/rakuten-publishers/.rvm/gems/ruby-2.4.1
-----> Fetching new git commits
# ...

and

$ cd /path/to/deployment
$ ls releases/
1  2

Both with seemingly correct deployments.

@endoze
Copy link
Owner

endoze commented Jan 3, 2018

@samnissen That's an interesting problem. I'll see if I can reproduce to see what's going on. Thank you for reporting your issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants