Walks develop.watch.path and checks which files should be copied inside the container ignores develop.watch.ignore, Dockerfile, compose files, bind mounted paths and .git
(ctx context.Context, project *types.Project, service types.ServiceConfig, trigger types.Trigger, syncer sync.Syncer)
| 739 | // Walks develop.watch.path and checks which files should be copied inside the container |
| 740 | // ignores develop.watch.ignore, Dockerfile, compose files, bind mounted paths and .git |
| 741 | func (s *composeService) initialSync(ctx context.Context, project *types.Project, service types.ServiceConfig, trigger types.Trigger, syncer sync.Syncer) error { |
| 742 | dockerIgnores, err := watch.LoadDockerIgnore(service.Build) |
| 743 | if err != nil { |
| 744 | return err |
| 745 | } |
| 746 | |
| 747 | dotGitIgnore, err := watch.NewDockerPatternMatcher("/", []string{".git/"}) |
| 748 | if err != nil { |
| 749 | return err |
| 750 | } |
| 751 | |
| 752 | triggerIgnore, err := watch.NewDockerPatternMatcher(trigger.Path, trigger.Ignore) |
| 753 | if err != nil { |
| 754 | return err |
| 755 | } |
| 756 | // FIXME .dockerignore |
| 757 | ignoreInitialSync := watch.NewCompositeMatcher( |
| 758 | dockerIgnores, |
| 759 | watch.EphemeralPathMatcher(), |
| 760 | dotGitIgnore, |
| 761 | triggerIgnore) |
| 762 | |
| 763 | pathsToCopy, err := s.initialSyncFiles(ctx, project, service, trigger, ignoreInitialSync) |
| 764 | if err != nil { |
| 765 | return err |
| 766 | } |
| 767 | |
| 768 | return syncer.Sync(ctx, service.Name, pathsToCopy) |
| 769 | } |
| 770 | |
| 771 | // Syncs files from develop.watch.path if they have been modified after the image has been created |
| 772 | // |
no test coverage detected