Skip to content

Commit

Permalink
patched cloudignore rules
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and [email protected] committed Jul 30, 2019
1 parent 03e22c5 commit ba63036
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ require (
github.com/viant/assertly v0.5.1
github.com/viant/bgc v0.7.0
github.com/viant/dsc v0.11.0
github.com/viant/dsunit v0.10.1
github.com/viant/dsunit v0.10.3
github.com/viant/neatly v0.8.0
github.com/viant/toolbox v0.26.0
github.com/yuin/gopher-lua v0.0.0-20190514113301-1cd887cd7036 // indirect
Expand Down
2 changes: 1 addition & 1 deletion shared/static/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
func init() {
var memStorage = storage.NewMemoryService()
{
err := memStorage.Upload("mem://github.com/viant/endly/Version", bytes.NewReader([]byte{48, 46, 52, 49, 46, 48, 10}))
err := memStorage.Upload("mem://github.com/viant/endly/Version", bytes.NewReader([]byte{48, 46, 52, 49, 46, 49, 10}))
if err != nil {
log.Printf("failed to upload: mem://github.com/viant/endly/Version %v", err)
}
Expand Down
9 changes: 6 additions & 3 deletions system/cloud/gcp/cloudfunctions/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ func (s *service) getFunctionPackageReader(resource *url.Resource) (io.ReadClose
return storageService.DownloadWithURL(resource.URL)
}

ignoreList := util.GetIgnoreList(storageService, toolbox.URLPathJoin(resource.URL, ".gcloudignore"))

gitIgnorePath := toolbox.URLPathJoin(resource.URL, ".gcloudignore")
ignoreList := util.GetIgnoreList(storageService, gitIgnorePath)
writer := new(bytes.Buffer)
archive := zip.NewWriter(writer)
err = storage.ArchiveWithFilter(storageService, resource.URL, archive, func(candidate storage.Object) bool {
Expand All @@ -135,9 +136,11 @@ func (s *service) getFunctionPackageReader(resource *url.Resource) (io.ReadClose
return true
}
relativePath := candidate.URL()

if relativePathIndex := strings.Index(relativePath, resource.URL);relativePathIndex !=-1 {
relativePath = string(relativePath[relativePathIndex+len(resource.URL)+1:])
relativePath = string(relativePath[relativePathIndex+len(resource.URL):])
if strings.HasPrefix(relativePath, "/") {
relativePath = string(relativePath[1:])
}
}
return !util.ShouldIgnoreLocation(relativePath,ignoreList)

Expand Down

0 comments on commit ba63036

Please sign in to comment.