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

git clone '.' path already exists #190

Closed
burn4ever opened this issue May 10, 2014 · 4 comments
Closed

git clone '.' path already exists #190

burn4ever opened this issue May 10, 2014 · 4 comments

Comments

@burn4ever
Copy link

Hey I´m new to mina but I have an problem with the deploy, especially with the git: clone command and find no solution at the www.
After mian setup I received this:

-----> Cloning the Git repository
$ git clone "https://[email protected]/user/www.mydomain.com.git" "development/newproject/scm" --bare
Cloning into bare repository development/newproject/scm...
Password:
remote: Counting objects: 1512, done.
remote: Compressing objects: 100% (1318/1318), done.
remote: Total 1512 (delta 206), reused 1373 (delta 150)
Receiving objects: 100% (1512/1512), 10.04 MiB | 3.67 MiB/s, done.
Resolving deltas: 100% (206/206), done.
-----> Using git branch 'master'
$ git clone "development/newproject/scm" . --recursive --branch "master"
fatal: destination path '.' already exists and is not an empty directory.
! ERROR: Deploy failed.
-----> Cleaning up build
$ rm -rf "$build_path"
Unlinking current
$ rm -f "deploy.lock"
OK
Connection to s4454454545.online.de closed.

! Command failed.
Failed with status 4864

Sure the folder isn´t empty cause mina creates the shared and releases before.
So how can I handle this to make the setup happend?

Here my mina deploy:
desc "Deploys the current version to the server."
task :deploy => :environment do
deploy do
# Put thingiths that will set up an empty directory into a fully set-up
# instance of your project.
invoke :'git:clone'
invoke :'deploy:link_shared_paths'
end
end

@jamesbrooks
Copy link

Would you be able to include your entire deploy.rb file? thanks.

@burn4ever
Copy link
Author

Yes, sure and thanks.
User and domain settings are random in this example.

#require 'mina/bundler'
#require 'mina/rails'
require 'mina/git'

Basic settings:

set :domain, 'r4564564564564.online.de'
set :deploy_to, 'development/myproject'
set :repository, 'https://[email protected]/nova/www.myproject.de.git'
set :branch, 'master'
set :user, '454564654' # Username in the server to SSH to.
set :term_mode, :nil # Fixed Permission denied

set :shared_paths, ['wp-content/uploads']

task :environment do

If you're using rbenv, use this to load the rbenv environment.

Be sure to commit your .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

task :setup => :environment do
queue! %[mkdir -p "#{deploy_to}/shared/wp-content/uploads"]
end

desc "Deploys the current version to the server."
task :deploy => :environment do
deploy do
# Put thingiths that will set up an empty directory into a fully set-up
# instance of your project.
invoke :'git:clone'
invoke :'deploy:link_shared_paths'
end
end

desc "Rollback to previous verison."
task :rollback => :environment do
queue %[echo "----> Start to rollback"]
queue %[if [ $(ls #{deploy_to}/releases | wc -l) -gt 1 ]; then echo "---->Relink to previos release" && unlink #{deploy_to}/current && ln -s #{deploy_to}/releases/"$(ls #{deploy_to}/releases | tail -2 | head -1)" #{deploy_to}/current && echo "Remove old releases" && rm -rf #{deploy_to}/releases/"$(ls #{deploy_to}/releases | tail -1)" && echo "$(ls #{deploy_to}/releases | tail -1)" > #{deploy_to}/last_version && echo "Done. Rollback to v$(cat #{deploy_to}/last_version)" ; else echo "No more release to rollback" ; fi]
end

@burn4ever
Copy link
Author

No tiny advice?

@phildionne
Copy link

Same problem here. Here's my deploy.rb

require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rbenv'
require 'mina/unicorn'

# Basic settings
set :deploy_to,   '/home/deploy/wsmdb'                           # Path to deploy into.
set :repository,  '[email protected]:phildionne/xxxxxx.git'   # Git repo to clone from. (needed by mina/git)
set :branch,      'master'                                                    # Branch name to deploy. (needed by mina/git)

task :dev do
  set :domain, 'foobar.com'
  set :branch, 'master'
end

task :staging do
  set :domain, 'foobar.com'
  set :branch, 'master'
end

task :production do
  set :domain, 'foobar.com'
  set :branch, 'master'
end

set :shared_paths, ['log']

# SSH settings
set :user, 'deploy'       # Username in the server to SSH to.
set :port, '22'           # SSH port number.
set :forward_agent, true

# Optional settings
set :unicorn_pid,   "#{deploy_to}/shared/pids/unicorn.pid"

task :environment do
  invoke :'rbenv:load'
end

task :setup => :environment do
  queue! %[mkdir -p "#{deploy_to}/shared/log"]
  queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/log"]

  queue! %[mkdir -p "#{deploy_to}/shared/config"]
  queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/config"]

  # Unicorn needs a place to store its pid file and log file
  queue! %[mkdir -p "#{deploy_to}/shared/pids/"]
  queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/pids"]

  queue! %[mkdir -p "#{deploy_to}/shared/sockets/"]
  queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/sockets"]
end

desc "Deploys the current version to the server."
task :deploy => :environment do
  deploy do
    invoke :'git:clone'
    invoke :'deploy:link_shared_paths'
    invoke :'bundle:install'
    invoke :'rails:db_migrate'
    invoke :'rails:assets_precompile'

    to :launch do
      invoke :'unicorn:restart'
    end
  end
end

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

4 participants