1

I deployed the project by capistrano from git.

There are some files which are stored in git but not want to be copied to deploy server.

in git, file structure.

myapp     - mainapp
          - somesetting.txt
          - _NoWanttoDeploy.txt // I don't want to deploy this file

These are deploy.rb

# config valid for current version and patch releases of Capistrano
lock "~> 3.11.2"

set :application, "myapp"
set :repo_url, "ssh://app@git.example.com/~/myGit/myapp.git"

set :branch, 'master'
set :deploy_to, "/var/www/html/myapp"

set :linked_dirs, fetch(:linked_dirs, []).push('static')

set :keep_releases, 3

How can I set???

whitebear
  • 11,200
  • 24
  • 114
  • 237

1 Answers1

1

how about copy_exclude?

set :copy_exclude, "_NoWanttoDeploy.txt"
Fernand
  • 1,293
  • 1
  • 10
  • 18
  • Somehow `copy_exclude` doesn't work.I googled around and found the same case, so I gave up to use `copy_exclude`. use `namespace :deploy do desc 'mytest' task :mydelete do on roles(:app) do execute "rm -rf /var/www/html/myapp/current/_NoDeploy" end end after :publishing, :mydelete end` instead , but thank you very much for your comment. – whitebear Mar 03 '20 at 09:18