Skip to content

Commit

Permalink
feat(manager/dockerfile): support file names that are all lowercase (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dotboris committed May 3, 2023
1 parent 97c3ae9 commit 18ddc2f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/usage/configuration-options.md
Expand Up @@ -932,7 +932,7 @@ At other times, the possible files is too vague for Renovate to have any default
For default, Kubernetes manifests can exist in any `*.yaml` file and we don't want Renovate to parse every single YAML file in every repository just in case some of them have a Kubernetes manifest, so Renovate's default `fileMatch` for manager `kubernetes` is actually empty (`[]`) and needs the user to tell Renovate what directories/files to look in.

Finally, there are cases where Renovate's default `fileMatch` is good, but you may be using file patterns that a bot couldn't possibly guess about.
For example, Renovate's default `fileMatch` for `Dockerfile` is `['(^|/|\\.)Dockerfile$', '(^|/)Dockerfile[^/]*$']`.
For example, Renovate's default `fileMatch` for `Dockerfile` is `['(^|/|\\.)([Dd]ocker|[Cc]ontainer)file$', '(^|/)([Dd]ocker|[Cc]ontainer)file[^/]*$']`.
This will catch files like `backend/Dockerfile`, `prefix.Dockerfile` or `Dockerfile-suffix`, but it will miss files like `ACTUALLY_A_DOCKERFILE.template`.
Because `fileMatch` is mergeable, you don't need to duplicate the defaults and could just add the missing file like this:

Expand Down
4 changes: 2 additions & 2 deletions lib/modules/manager/dockerfile/index.ts
Expand Up @@ -8,8 +8,8 @@ export { extractPackageFile };

export const defaultConfig = {
fileMatch: [
'(^|/|\\.)(Docker|Container)file$',
'(^|/)(Docker|Container)file[^/]*$',
'(^|/|\\.)([Dd]ocker|[Cc]ontainer)file$',
'(^|/)([Dd]ocker|[Cc]ontainer)file[^/]*$',
],
};

Expand Down
Expand Up @@ -100,8 +100,8 @@ describe('workers/repository/extract/extract-fingerprint-config', () => {
enabled: true,
fileList: [],
fileMatch: [
'(^|/|\\.)(Docker|Container)file$',
'(^|/)(Docker|Container)file[^/]*$',
'(^|/|\\.)([Dd]ocker|[Cc]ontainer)file$',
'(^|/)([Dd]ocker|[Cc]ontainer)file[^/]*$',
],
ignorePaths: ['**/node_modules/**', '**/bower_components/**'],
includePaths: [],
Expand Down

0 comments on commit 18ddc2f

Please sign in to comment.