Capistrano - how to disable git pull (Bitbucket pipelines)

181 Views Asked by At

I have deploy via bitbucket pipelines, which is uses Capistrano for deploy release to server. But there is one problem, Capistrano is pulling actual version of branch, but i need to deploy not actual branch, but version from pipeline(this need for redeploy previous stable version). And because in pipeline is already needed version of files, i just need to disable pulling if its possible.


Used ruby bundle for deploy.

Ruby: 2.5.5

Capistrano 3.8.0

Part of deploy.rb configuration:


set :repo_url, '[email protected]:user/repo.git'
set :deploy_via, :remote_cache
set :copy_exclude, [ '.git' ]
set :pty, true

Thanks.

I was tried to replace git command for disable git pull with command:

replace_git_pull() { 
  if [ $1 = "pull" ]; then 
    echo "Git pull is disabled, exit";
    return 0;
  fi;
 $(which git) "$@";
}

alias git='replace_git_pull'

Locally its works, but its doesn't have affect to Capistrano deploy, seems like Capistrano not uses console for pulling.

Tried replace git:update command, - receive error.

1

There are 1 best solutions below

0
Oleh Diachenko On

Deployment tool was changed to Deployer (php) https://github.com/deployphp/deployer