summaryrefslogtreecommitdiffstats
path: root/deploy/deploy.go
diff options
context:
space:
mode:
authorGarret Kelly <gdk@google.com>2019-10-03 08:46:27 -0400
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-10-03 16:53:45 +0200
commit674e81ae8700bdd00d3e5e47ff930d42d25bc68b (patch)
tree5e88e28df459e99dc77a4ab5845c8be12db38fa7 /deploy/deploy.go
parent298092d516f623cc20051f506d460fb7625cdc84 (diff)
deploy: Add ability to invalidate Google Cloud CDN
Diffstat (limited to 'deploy/deploy.go')
-rw-r--r--deploy/deploy.go19
1 files changed, 14 insertions, 5 deletions
diff --git a/deploy/deploy.go b/deploy/deploy.go
index 9092431a5..1d911f29b 100644
--- a/deploy/deploy.go
+++ b/deploy/deploy.go
@@ -249,11 +249,20 @@ func (d *Deployer) Deploy(ctx context.Context) error {
jww.FEEDBACK.Println("Success!")
}
- if d.invalidateCDN && d.target.CloudFrontDistributionID != "" {
- jww.FEEDBACK.Println("Invalidating CloudFront CDN...")
- if err := InvalidateCloudFront(ctx, d.target.CloudFrontDistributionID); err != nil {
- jww.FEEDBACK.Printf("Failed to invalidate CloudFront CDN: %v\n", err)
- return err
+ if d.invalidateCDN {
+ if d.target.CloudFrontDistributionID != "" {
+ jww.FEEDBACK.Println("Invalidating CloudFront CDN...")
+ if err := InvalidateCloudFront(ctx, d.target.CloudFrontDistributionID); err != nil {
+ jww.FEEDBACK.Printf("Failed to invalidate CloudFront CDN: %v\n", err)
+ return err
+ }
+ }
+ if d.target.GoogleCloudCDNOrigin != "" {
+ jww.FEEDBACK.Println("Invalidating Google Cloud CDN...")
+ if err := InvalidateGoogleCloudCDN(ctx, d.target.GoogleCloudCDNOrigin); err != nil {
+ jww.FEEDBACK.Printf("Failed to invalidate Google Cloud CDN: %v\n", err)
+ return err
+ }
}
jww.FEEDBACK.Println("Success!")
}