0

on my server I´m not allowed to create an tmp folder that executes any content. So with capistrano 3 I have the option to set a path for a kind of custom tmp folder. Is there any syntax I have to consider, cause my settings execute an error with cap staging deploy:

INFO[f99c486e] Running /usr/bin/env mkdir -p custom_tmp/myproject/ on xxxx.de
DEBUG[f99c486e] Command: /usr/bin/env mkdir -p custom_tmp/myproject/
INFO[f99c486e] Finished in 1.140 seconds with exit status 0 (successful).
DEBUGUploading custom_tmp/myproject/git-ssh.sh 0.0%
INFOUploading custom_tmp/myproject/git-ssh.sh 100.0%
INFO[91b7d9b8] Running /usr/bin/env chmod +x custom_tmp/myproject/git-ssh.sh on xxxx.de
DEBUG[91b7d9b8] Command: /usr/bin/env chmod +x custom_tmp/myproject/git-ssh.sh
INFO[91b7d9b8] Finished in 0.080 seconds with exit status 0 (successful).
DEBUG[f4db290c] Running /usr/bin/env git ls-remote -h git@bitbucket.org:hallo/www.myproject.de.git on xxxx.de
DEBUG[f4db290c] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=custom_tmp/myproject/git-ssh.sh /usr/bin/env git ls-remote -h git@bitbucket.org:hallo/www.myproject.de.git )
DEBUG[f4db290c]     66791b22a61cd1af57d117a817129e491e83d88c    refs/heads/master
DEBUG[f4db290c] Finished in 3.235 seconds with exit status 0 (successful).
INFO[74118c8e] Running /usr/bin/env mkdir -pv development/myproject/shared development/myproject/releases on xxxx.de
DEBUG[74118c8e] Command: /usr/bin/env mkdir -pv development/myproject/shared development/myproject/releases
INFO[74118c8e] Finished in 0.079 seconds with exit status 0 (successful).
INFO[10e40636] Running /usr/bin/env mkdir -pv development/myproject/shared/media on xxxx.de
DEBUG[10e40636] Command: /usr/bin/env mkdir -pv development/myproject/shared/media
INFO[10e40636] Finished in 0.086 seconds with exit status 0 (successful).
DEBUG[38889a64] Running /usr/bin/env [ -f development/myproject/current/REVISION ] on xxxx.de
DEBUG[38889a64] Command: [ -f development/myproject/current/REVISION ]
DEBUG[38889a64] Finished in 0.079 seconds with exit status 1 (failed).
DEBUG[5dfc387f] Running /usr/bin/env [ -f development/myproject/repo/HEAD ] on xxxx.de
DEBUG[5dfc387f] Command: [ -f development/myproject/repo/HEAD ]
DEBUG[5dfc387f] Finished in 0.095 seconds with exit status 1 (failed).
DEBUG[44d0214c] Running /usr/bin/env if test ! -d development/myproject/; then echo "Directory does not exist 'development/myproject/'" 1>&2; false; fi on xxxx.de
DEBUG[44d0214c] Command: if test ! -d development/myproject/; then echo "Directory does not exist 'development/myproject/'" 1>&2; false; fi
DEBUG[44d0214c] Finished in 0.079 seconds with exit status 0 (successful).
INFO[dac1f8fd] Running /usr/bin/env git clone --mirror git@bitbucket.org:hallo/www.myproject.de.git development/myproject/repo on xxxx.de
DEBUG[dac1f8fd] Command: cd development/myproject/ && ( GIT_ASKPASS=/bin/echo GIT_SSH=custom_tmp/myproject/git-ssh.sh /usr/bin/env git clone --mirror git@bitbucket.org:hallo/www.myproject.de.git development/myproject/repo )
DEBUG[dac1f8fd]     Cloning into bare repository development/myproject/repo...
DEBUG[dac1f8fd]     error: cannot run custom_tmp/myproject/git-ssh.sh: No such file or directory
DEBUG[dac1f8fd]     fatal: unable to fork
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host xxxx.de: git exit status: 128
git stdout: Nothing written
git stderr: Nothing written

On my server the folder "custom_tmp/myproject/" ist still there with there with the git-ssh.sh. So I wonder about the error. Here my deploy.rb

#config valid only for Capistrano 3.1
lock '3.2.1'

set :application, 'myproject'
set :repo_url, 'git@bitbucket.org:hallo/www.myproject.de.git'

# Default deploy_to directory is /var/www/my_app
set :deploy_to, 'development/myproject/'

#Default value for :scm is :git
#set :scm, :git

#Default value for :format is :pretty
#set :format, :pretty

# Default value for :log_level is :debug
set :log_level, :debug

#Default value for :pty is false
set :pty, true

# Default value for :linked_files is []
# set :linked_files, %w{config/database.yml}

# Default value for linked_dirs is []
set :linked_dirs, %w{media}

#tmp dir 
set :tmp_dir,"custom_tmp"

namespace :deploy do

  desc 'Restart application'
  task :restart do
    on roles(:app) do
      # Your restart mechanism here, for example:
      # execute :touch, release_path.join('tmp/restart.txt')
    end
  end

end
burn4ever
  • 1
  • 1
  • 3

2 Answers2

0

Okay, I´m one step closer. The path to my tmp dir wasn´t correct. I did an pwd on my server and put the shown path in front of my "custom_tmp" like:

set :tmp_dir,"/cutomer/homeages/13/233232/custom_tmp"

But the cap staging deploy interrupt by an new error depending on the repo folder:

fatal: destination path 'development/www.myproject.com/repo' already exists and is not an empty directory.

burn4ever
  • 1
  • 1
  • 3
0

okay, I got it. Have to do the same with the: set :deploy_to

burn4ever
  • 1
  • 1
  • 3