From db05a259e042dd039dfb37dcd38657e008227c4d Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@keylocation.sg> Date: Tue, 24 Oct 2017 05:24:15 +0200 Subject: [PATCH] refactor: improve docker pin templates (#1032) --- docs/configuration.md | 3 ++- lib/config/definitions.js | 1 + lib/config/templates/docker-pin/branch-name.hbs | 1 + lib/config/templates/docker-pin/pr-title.hbs | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 lib/config/templates/docker-pin/branch-name.hbs diff --git a/docs/configuration.md b/docs/configuration.md index 622ca4a919..fc09388b31 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -775,7 +775,8 @@ Obviously, you can't set repository or package file location with this method. "prTitle": "Update Dockerfile image {{depName}}@{{currentTag}} digest", "prBody": "This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request updates Docker base image `{{depName}}@{{currentTag}}` to the latest digest (`{{newDigest}}`).\n\n{{#if schedule}}\n**Note**: This PR was created on a configured schedule (\"{{schedule}}\"{{#if timezone}} in timezone `{{timezone}}`{{/if}}) and will not receive updates outside those times.\n{{/if}}\n\n{{#if hasErrors}}\n\n---\n\n### Errors\n\nRenovate encountered some errors when processing your repository, so you are being notified here even if they do not directly apply to this PR.\n\n{{#each errors as |error|}}\n- `{{error.depName}}`: {{error.message}}\n{{/each}}\n{{/if}}\n\n{{#if hasWarnings}}\n\n---\n\n### Warnings\n\nPlease make sure the following warnings are safe to ignore:\n\n{{#each warnings as |warning|}}\n- `{{warning.depName}}`: {{warning.message}}\n{{/each}}\n{{/if}}\n\n---\n\nThis {{#if isGitHub}}PR{{else}}MR{{/if}} has been generated by [Renovate Bot](https://renovateapp.com).", "pin": { - "prTitle": "Pin Dockerfile image {{depName}}@{{currentTag}} digest", + "branchName": "{{branchPrefix}}docker-pin-{{depNameSanitized}}-{{currentTag}}", + "prTitle": "Pin Dockerfile {{depName}}@{{currentTag}} image digest", "prBody": "This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request pins Docker base image `{{depName}}@{{currentTag}}` to use a digest (`{{newDigest}}`).\nThis digest will then be kept updated via Pull Requests whenever the image is updated on the Docker registry.\n\n{{#if schedule}}\n**Note**: This PR was created on a configured schedule (\"{{schedule}}\"{{#if timezone}} in timezone `{{timezone}}`{{/if}}) and will not receive updates outside those times.\n{{/if}}\n\n{{#if hasErrors}}\n\n---\n\n### Errors\n\nRenovate encountered some errors when processing your repository, so you are being notified here even if they do not directly apply to this PR.\n\n{{#each errors as |error|}}\n- `{{error.depName}}`: {{error.message}}\n{{/each}}\n{{/if}}\n\n{{#if hasWarnings}}\n\n---\n\n### Warnings\n\nPlease make sure the following warnings are safe to ignore:\n\n{{#each warnings as |warning|}}\n- `{{warning.depName}}`: {{warning.message}}\n{{/each}}\n{{/if}}\n\n---\n\nThis {{#if isGitHub}}PR{{else}}MR{{/if}} has been generated by [Renovate Bot](https://renovateapp.com).", "groupName": "Pin Docker Digests", "group": { diff --git a/lib/config/definitions.js b/lib/config/definitions.js index 1c2310aa1d..de02d29e7b 100644 --- a/lib/config/definitions.js +++ b/lib/config/definitions.js @@ -608,6 +608,7 @@ const options = [ prTitle: template('prTitle', 'docker'), prBody: template('prBody', 'docker'), pin: { + branchName: template('branchName', 'docker-pin'), prTitle: template('prTitle', 'docker-pin'), prBody: template('prBody', 'docker-pin'), groupName: 'Pin Docker Digests', diff --git a/lib/config/templates/docker-pin/branch-name.hbs b/lib/config/templates/docker-pin/branch-name.hbs new file mode 100644 index 0000000000..1e2d8ecf70 --- /dev/null +++ b/lib/config/templates/docker-pin/branch-name.hbs @@ -0,0 +1 @@ +{{branchPrefix}}docker-pin-{{depNameSanitized}}-{{currentTag}} diff --git a/lib/config/templates/docker-pin/pr-title.hbs b/lib/config/templates/docker-pin/pr-title.hbs index ba04e76386..2a685c1c42 100644 --- a/lib/config/templates/docker-pin/pr-title.hbs +++ b/lib/config/templates/docker-pin/pr-title.hbs @@ -1 +1 @@ -Pin Dockerfile image {{depName}}@{{currentTag}} digest +Pin Dockerfile {{depName}}@{{currentTag}} image digest -- GitLab