Created
June 12, 2015 08:25
-
-
Save stramargio/6f00aa4a2a9ac0c2d8ab to your computer and use it in GitHub Desktop.
fix deploy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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