Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
executable file
·
32 lines (25 loc) · 886 Bytes

File metadata and controls

executable file
·
32 lines (25 loc) · 886 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env ruby
require_relative '../deployment'
require 'cdo/rake_utils'
require 'cdo/aws/cloudfront'
require 'sshkit'
SSHKit::Backend::Netssh.configure {|ssh| ssh.ssh_options = {paranoid: false}}
unless CDO.daemon
CDO.log.error 'This script must be run on daemon'
exit 1
end
if system 'systemctl is-active --quiet varnish'
varnish_ban_cmd = "sudo varnishadm -T localhost:6082 -S /etc/varnish/secret 'ban obj.status ~ .'"
CDO.log.info 'Flushing Varnish cache on daemon...'
RakeUtils.system varnish_ban_cmd
app_servers = CDO.app_servers.values
unless app_servers.empty?
CDO.log.info 'Flushing Varnish caches on frontends...'
SSHKit::Coordinator.new(app_servers).each do
execute varnish_ban_cmd, raise_on_non_zero_exit: false
end
end
end
CDO.log.info 'Flushing CloudFront caches...'
AWS::CloudFront.invalidate_caches
CDO.log.info 'All done!'
Morty Proxy This is a proxified and sanitized view of the page, visit original site.