You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require'mina/rails'require'mina/git'require'mina_sidekiq/tasks'# require 'mina/rbenv' # for rbenv support. (https://rbenv.org)# require 'mina/rvm' # for rvm support. (https://rvm.io)# Basic settings:# domain - The hostname to SSH to.# deploy_to - Path to deploy into.# repository - Git repo to clone from. (needed by mina/git)# branch - Branch name to deploy. (needed by mina/git)set:application_name,'muse'set:domain,'xx.xxx.xx.xxx'set:deploy_to,'/home/deploy/app'set:repository,'[email protected]:KudosX/muse.git'set:branch,'master'# Optional settings:set:user,'deploy'# Username in the server to SSH to.# set :port, '30000' # SSH port number.set:forward_agent,true# SSH forward_agent.# shared dirs and files will be symlinked into the app-folder by the 'deploy:link_shared_paths' step.set:shared_dirs,fetch(:shared_dirs,[]).push('log','tmp','public','tmp/pids','tmp/sockets')set:shared_files,fetch(:shared_files,[]).push('config/database.yml','config/secrets.yml','config/app_credentials.yml','config/omni_contacts.yml','config/cable.yml','config/ses.yml')set:sidekiq,->{"#{fetch(:bundle_prefix)} sidekiq"}# This task is the environment that is loaded for all remote run commands, such as# `mina deploy` or `mina rake`.task:environmentdo# If you're using rbenv, use this to load the rbenv environment.# Be sure to commit your .ruby-version or .rbenv-version to your repository.# invoke :'rbenv:load'# For those using RVM, use this to load an RVM version@gemset.# invoke :'rvm:use', 'ruby-1.9.3-p125@default'end# Put any custom commands you need to run at setup# All paths in `shared_dirs` and `shared_paths` will be created on their own.task:setupdo# command %{rbenv install 2.3.0}# command %[mkdir -p "#{deploy_to}/current"]command%(mkdir -p "#{fetch(:deploy_to)}/shared/pids/")command%(mkdir -p "#{fetch(:deploy_to)}/shared/log/")command%[touch "#{fetch(:shared_path)}/config/database.yml"]command%[touch "#{fetch(:shared_path)}/config/secrets.yml"]command%[touch "#{fetch(:shared_path)}/config/app_credentials.yml"]command%[touch "#{fetch(:shared_path)}/config/omni_contacts.yml"]command%[touch "#{fetch(:shared_path)}/config/cable.yml"]command%[touch "#{fetch(:shared_path)}/config/ses.yml"]command%[echo "-----> Be sure to edit '#{fetch(:shared_path)}/config/database.yml', 'cable.yml', 'secrets.yml', 'app_credentials.yml' and 'omni_contacts.yml'."]enddesc"Deploys the current version to the server."task:deploydo# uncomment this line to make sure you pushed your local branch to the remote origin# invoke :'git:ensure_pushed'deploydo# Put things that will set up an empty directory into a fully set-up# instance of your project.# stop accepting new workersinvoke:'sidekiq:quiet'invoke:'git:clone'invoke:'deploy:link_shared_paths'invoke:'bundle:install'invoke:'rails:db_create'# later to removeinvoke:'rails:db_migrate'invoke:'rails:assets_precompile'invoke:'deploy:cleanup'on:launchdoin_path(fetch(:current_path))docommand%{mkdir -p tmp/}command%{touch tmp/restart.txt}endinvoke:'sidekiq:restart'endend# you can use `run :local` to run tasks on local machine before of after the deploy scripts# run(:local){ say 'done' }endtask:'elasticsearch:start'docomment'start elasticsearch service'command%{sudo systemctl start elasticsearch.service}endtask:'elasticsearch:stop'docomment'stop elasticsearch service'command%{sudo systemctl stop elasticsearch.service}end# For help in making your deploy script, see the Mina documentation:## - https://github.com/mina-deploy/mina/tree/master/docs
I ran mina:setup. Now when I try to deploy getting below error:
bundle exec mina deploy -v
-----> Creating a temporary build path
$ touch "deploy.lock"
$ mkdir -p "$build_path"
$ cd"$build_path"
-----> Quiet sidekiq (stop accepting new work)
bash: line 50: cd: /home/deploy/app/current: No such file or directory
! ERROR: Deploy failed.
-----> Cleaning up build
$ rm -rf "$build_path"
Unlinking current
$ rm -f "deploy.lock"
OK
Connection to 'xx.xxx.xx.xxx' closed.
! Run Error
Any idea why current folder is not being created automatically?
The text was updated successfully, but these errors were encountered:
When you deploy a new project, and you have invoke :'sidekiq:quiet' inside deploy script, it tries to cd into the current folder and it didn't find it. The reason is pretty obvious. Due to this I was getting the above error. I commented out the line on my first deploy and it went well. On next deploy on wards it is not a problem. I think this is a bug in the mina-sidekiq project. It can be fixed though.
I'm using
gem 'mina', '~> 1.0', '>= 1.0.6'
.Below is my
deploy.rb
:I ran
mina:setup
. Now when I try to deploy getting below error:Any idea why
current
folder is not being created automatically?The text was updated successfully, but these errors were encountered: