1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-08-10 22:41:25 +02:00

Set static file sync content type by file extension

This commit is contained in:
Lee Brown
2019-08-07 16:40:56 -08:00
parent bf1ec63d85
commit 13ad786d02
2 changed files with 34 additions and 18 deletions

View File

@@ -3329,6 +3329,10 @@ func ServiceDeploy(log *log.Logger, req *serviceDeployRequest) error {
staticDir := filepath.Join(req.ServiceDir, "static")
if _, err := os.Stat(staticDir); err != nil {
return errors.Wrapf(err, "Static directory '%s' does not exist.", staticDir)
}
err := SyncPublicS3Files(req.awsSession(), req.S3BucketPublicName, req.StaticFilesS3Prefix, staticDir)
if err != nil {
return errors.Wrapf(err, "Failed to sync static files from %s to s3://%s/%s", staticDir, req.S3BucketPublicName, req.StaticFilesS3Prefix)