Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hugo deploy ignores patterns always removing files #6681

Closed
ssbarnea opened this issue Dec 29, 2019 · 4 comments
Closed

hugo deploy ignores patterns always removing files #6681

ssbarnea opened this issue Dec 29, 2019 · 4 comments

Comments

@ssbarnea
Copy link

@ssbarnea ssbarnea commented Dec 29, 2019

My website is hosted on a AWS S3 bucket which also containst other files not managed by hugo. That works on a bare domain which means that I cannot move conttent another bucket to isolate hugo generated site.

I tried to use patterns to control deployment but apparent it has zero effect, it always ignore them.

deployment:
  targets:
    - name: aws
      URL: s3://bucket?region=eu-west-1
  matchers:
    - pattern: "^posts\\/"

What version of Hugo are you using (hugo version)?

$ hugo version
Hugo Static Site Generator v0.62.0/extended darwin/amd64 BuildDate: unknown

Does this issue reproduce with the latest release?

Yes

References

@bep

This comment has been minimized.

Copy link
Member

@bep bep commented Dec 29, 2019

That's not what the matchers are there for.

There is a prefix that allows you to publish to a bucket sub path. But Hugo must "own" that sub path. If you want to preserve file there you need to set maxDeletes to 0 or something.

@bep

This comment has been minimized.

Copy link
Member

@bep bep commented Dec 29, 2019

I notice you also raised an issue on the forum.

@bep bep closed this Dec 29, 2019
@ssbarnea

This comment has been minimized.

Copy link
Author

@ssbarnea ssbarnea commented Dec 30, 2019

@bep I do not think that this bug should be closed, maybe transformed in a feature request but clearly not closed.

As we all know, AWS S3 buckets are a flat, with no folders but let's assume they are as their technical detail should not affect behaviour.

Deploying to a prefix path makes no sense when you try to publish a website. AWS S3+CloudForm does require you to use bucket root. There is nothing to configure about that on AWS as far as I know.

Now that I read the documentation again I finally realize the matchers are only for adding extra metadata to files.

I wonder if we could re-use the same matcher sections and patterns to tell hugo to skip/ignore those patterns, maybe something like:

matchers:
    - pattern: "/bigdata/"
      ignore: true  # any match on source of destination will be ignored (skipped).
@bep

This comment has been minimized.

Copy link
Member

@bep bep commented Dec 30, 2019

I almost never comment on closed issues.

I'm not sure what you mean by ClodForm, but I guess you mean CloudFlare.

I have not implemented this feature, but I'm very familiar with the AWS tech stack (see https://github.com/bep/s3deploy), and buckets don't need to be flat. If you want to discuss this, use the forum. We're not adding more complexity to this unless we get some really convincing arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.