Skip to content

Instantly share code, notes, and snippets.

@stramargio
Created June 12, 2015 08:25
Show Gist options
  • Save stramargio/6f00aa4a2a9ac0c2d8ab to your computer and use it in GitHub Desktop.
Save stramargio/6f00aa4a2a9ac0c2d8ab to your computer and use it in GitHub Desktop.
fix deploy
desc "Creates robots.txt for non-production envs"
task :create_robots do
on roles(:app) do
if fetch(:stage) != :production then
io = StringIO.new('User-agent: *
Disallow: /')
upload! io, File.join(release_path, "robots.txt")
execute :chmod, "644 #{release_path}/robots.txt"
end
end
end
desc "Force permission"
task :force_permissions do
execute :chmod, "777 #{release_path}/content/api/zip"
execute :chmod, "777 #{release_path}/content/api/download"
end
after :finished, :create_robots
after :finishing, "deploy:cleanup"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment