diff --git a/bin/install-yarn.sh b/bin/install-yarn.sh index 2ed7e9e8f37da555985494bde4e5d46450a28525..0bef7f3d6b2e7e7a92f690a550b865f2dfa079f0 100755 --- a/bin/install-yarn.sh +++ b/bin/install-yarn.sh @@ -1,7 +1,2 @@ -YARN_VERSION_INSTALLED=$(yarn --version) -YARN_VERSION_REQUIRED=$(grep yarn package.json | sed 's/ "yarn": "//' | sed 's/"//') -if [[ "$YARN_VERSION_INSTALLED" != "$YARN_VERSION_REQUIRED" ]]; then - echo "Installing Yarn $YARN_VERSION_REQUIRED" - rm -rf ~/.yarn - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $YARN_VERSION_REQUIRED -fi +YARN_VERSION_REQUIRED=$(grep '"yarn"' package.json | sed 's/ "yarn": "//' | sed 's/"//') +curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $YARN_VERSION_REQUIRED diff --git a/docs/configuration.md b/docs/configuration.md index f5bd594abfe4b37b3dbde3d4ec10b06b6bec8eb7..8e7d756df6d3fed6914b1840bf988c78377aaf9c 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -70,12 +70,11 @@ $ node renovate --help Options: -h, --help output usage information - --enabled [boolean] Enable or disable renovate + --log-level <string> Logging level --log-file <string> Log file path --log-file-level <string> Log file log level - --timezone <string> [IANA Time Zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) - --schedule <list> Times of day/week to renovate --onboarding [boolean] Require a Configuration PR first + --timezone <string> [IANA Time Zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) --platform <string> Platform type of repository --endpoint <string> Custom endpoint to use --token <string> Repository Auth Token @@ -97,14 +96,11 @@ $ node renovate --help --pr-creation <string> When to create the PR for a branch. Values: immediate, not-pending, status-success. --automerge <string> What types of upgrades to merge to base branch automatically. Values: none, minor or any --automerge-type <string> How to automerge - "branch-merge-commit", "branch-push" or "pr". Branch support is GitHub-only - --yarn-cache-folder <string> Location of yarn cache folder to use. Set to empty string to disable --lazy-grouping [boolean] Use group names only when multiple dependencies upgraded --group-name <string> Human understandable name for the dependency group - --group-slug <string> Slug to use for group (e.g. in branch name). Will be calculated from groupName if null --labels <list> Labels to add to Pull Request --assignees <list> Assignees for Pull Request --reviewers <list> Requested reviewers for Pull Requests (GitHub only) - --log-level <string> Logging level Examples: @@ -138,12 +134,13 @@ Obviously, you can't set repository or package file location with this method. | Name | Description | Type | Default value | Environment | CLI | |------|-------------|------|---------------|-------------|-----| -| `enabled` | Enable or disable renovate | boolean | `true` | `RENOVATE_ENABLED` | `--enabled` | +| `enabled` | Enable or disable renovate | boolean | `true` | | | +| `logLevel` | Logging level | string | `"info"` | `LOG_LEVEL` | `--log-level` | | `logFile` | Log file path | string | `null` | `RENOVATE_LOG_FILE` | `--log-file` | | `logFileLevel` | Log file log level | string | `"debug"` | `RENOVATE_LOG_FILE_LEVEL` | `--log-file-level` | -| `timezone` | [IANA Time Zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) | string | `null` | `RENOVATE_TIMEZONE` | `--timezone` | -| `schedule` | Times of day/week to renovate | list | `[]` | `RENOVATE_SCHEDULE` | `--schedule` | | `onboarding` | Require a Configuration PR first | boolean | `true` | `RENOVATE_ONBOARDING` | `--onboarding` | +| `timezone` | [IANA Time Zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) | string | `null` | `RENOVATE_TIMEZONE` | `--timezone` | +| `schedule` | Times of day/week to renovate | list | `[]` | | | | `platform` | Platform type of repository | string | `"github"` | `RENOVATE_PLATFORM` | `--platform` | | `endpoint` | Custom endpoint to use | string | `null` | `RENOVATE_ENDPOINT` | `--endpoint` | | `token` | Repository Auth Token | string | `null` | `RENOVATE_TOKEN` | `--token` | @@ -175,9 +172,10 @@ Obviously, you can't set repository or package file location with this method. | `commitMessage` | Commit message template | string | `"{{semanticPrefix}}Update dependency {{depName}} to version {{newVersion}}"` | `RENOVATE_COMMIT_MESSAGE` | | | `prTitle` | Pull Request title template | string | `"{{semanticPrefix}}{{#if isPin}}Pin{{else}}Update{{/if}} dependency {{depName}} to version {{#if isRange}}{{newVersion}}{{else}}{{#if isMajor}}{{newVersionMajor}}.x{{else}}{{newVersion}}{{/if}}{{/if}}"` | `RENOVATE_PR_TITLE` | | | `prBody` | Pull Request body template | string | `"This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request updates dependency [{{depName}}]({{repositoryUrl}}) from version `{{currentVersion}}` to `{{newVersion}}`\n{{#if releases.length}}\n\n### Commits\n\n<details>\n<summary>{{githubName}}</summary>\n\n{{#each releases as |release|}}\n#### {{release.version}}\n{{#each release.commits as |commit|}}\n- [`{{commit.shortSha}}`]({{commit.url}}) {{commit.message}}\n{{/each}}\n{{/each}}\n\n</details>\n{{/if}}\n<br />\n\nThis {{#if isGitHub}}PR{{else}}MR{{/if}} has been generated by [Renovate Bot](https://keylocation.sg/our-tech/renovate)."` | `RENOVATE_PR_BODY` | | -| `yarnCacheFolder` | Location of yarn cache folder to use. Set to empty string to disable | string | `"/tmp/yarn-cache"` | `RENOVATE_YARN_CACHE_FOLDER` | `--yarn-cache-folder` | +| `yarnCacheFolder` | Location of yarn cache folder to use. Set to empty string to disable | string | `"/tmp/yarn-cache"` | `RENOVATE_YARN_CACHE_FOLDER` | | | `lockFileMaintenance` | Configuration for lock file maintenance | json | `{ "enabled": true, + "recreateClosed": true, "branchName": "renovate/lock-files", "commitMessage": "{{semanticPrefix}}Update lock file", "prTitle": "{{semanticPrefix}}Lock file maintenance", @@ -186,14 +184,14 @@ Obviously, you can't set repository or package file location with this method. }` | | | | `lazyGrouping` | Use group names only when multiple dependencies upgraded | boolean | `true` | `RENOVATE_LAZY_GROUPING` | `--lazy-grouping` | | `groupName` | Human understandable name for the dependency group | string | `null` | `RENOVATE_GROUP_NAME` | `--group-name` | -| `groupSlug` | Slug to use for group (e.g. in branch name). Will be calculated from groupName if null | string | `null` | `RENOVATE_GROUP_SLUG` | `--group-slug` | +| `groupSlug` | Slug to use for group (e.g. in branch name). Will be calculated from groupName if null | string | `null` | | | | `group` | Config if groupName is enabled | json | `{ + "recreateClosed": true, "branchName": "renovate/{{groupSlug}}", "commitMessage": "{{semanticPrefix}}Renovate {{groupName}} packages", "prTitle": "{{semanticPrefix}}Renovate {{groupName}} packages", "prBody": "This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request renovates the package group \"{{groupName}}\".\n\n{{#each upgrades as |upgrade|}}\n- [{{upgrade.depName}}]({{upgrade.repositoryUrl}}): from `{{upgrade.currentVersion}}` to `{{upgrade.newVersion}}`\n{{/each}}\n\n{{#unless isPin}}\n### Commits\n\n{{#each upgrades as |upgrade|}}\n{{#if upgrade.releases.length}}\n<details>\n<summary>{{upgrade.githubName}}</summary>\n{{#each upgrade.releases as |release|}}\n\n#### {{release.version}}\n{{#each release.commits as |commit|}}\n- [`{{commit.shortSha}}`]({{commit.url}}){{commit.message}}\n{{/each}}\n{{/each}}\n\n</details>\n{{/if}}\n{{/each}}\n{{/unless}}\n<br />\n\nThis {{#if isGitHub}}PR{{else}}MR{{/if}} has been generated by [Renovate Bot](https://keylocation.sg/our-tech/renovate)." -}` | `RENOVATE_GROUP` | | +}` | | | | `labels` | Labels to add to Pull Request | list | `[]` | `RENOVATE_LABELS` | `--labels` | | `assignees` | Assignees for Pull Request | list | `[]` | `RENOVATE_ASSIGNEES` | `--assignees` | | `reviewers` | Requested reviewers for Pull Requests (GitHub only) | list | `[]` | `RENOVATE_REVIEWERS` | `--reviewers` | -| `logLevel` | Logging level | string | `"info"` | `LOG_LEVEL` | `--log-level` | diff --git a/lib/config/definitions.js b/lib/config/definitions.js index 5ab73e0654df0e34bcf27dfbddf4d674a23717df..61ac9e863bd4cee66df3c8a39b7b165b190bad59 100644 --- a/lib/config/definitions.js +++ b/lib/config/definitions.js @@ -22,6 +22,17 @@ const options = [ description: 'Enable or disable renovate', stage: 'package', type: 'boolean', + cli: false, + env: false, + }, + // Log options + { + name: 'logLevel', + description: 'Logging level', + stage: 'global', + type: 'string', + default: 'info', + env: 'LOG_LEVEL', }, { name: 'logFile', @@ -36,6 +47,15 @@ const options = [ type: 'string', default: 'debug', }, + // Onboarding + { + name: 'onboarding', + description: 'Require a Configuration PR first', + stage: 'repository', + type: 'boolean', + onboarding: false, + }, + // Scheduling { name: 'timezone', description: @@ -48,6 +68,8 @@ const options = [ description: 'Times of day/week to renovate', type: 'list', stage: 'package', + cli: false, + env: false, }, { name: 'onboarding', @@ -262,6 +284,7 @@ const options = [ stage: 'global', type: 'string', default: '/tmp/yarn-cache', + cli: false, }, { name: 'lockFileMaintenance', @@ -303,6 +326,8 @@ const options = [ 'Slug to use for group (e.g. in branch name). Will be calculated from groupName if null', type: 'string', default: null, + cli: false, + env: false, onboarding: false, }, { @@ -337,15 +362,6 @@ const options = [ description: 'Requested reviewers for Pull Requests (GitHub only)', type: 'list', }, - // Debug options - { - name: 'logLevel', - description: 'Logging level', - stage: 'global', - type: 'string', - default: 'info', - env: 'LOG_LEVEL', - }, ]; function getOptions() { diff --git a/package.json b/package.json index dcb87ca245b21ade6d3fb17950c172fab34acc20..6348b661eaff7827a7f32386b23a2e23093d018b 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "version": "0.0.0-semantic-release", "bin": "dist/renovate.js", "scripts": { - "build": "npm run transpile", + "build": "yarn && npm run transpile && cp -R lib/config/templates dist/config", "heroku-push": "git push heroku master", "heroku-scheduler": "heroku addons:open scheduler", "jest": "LOG_LEVEL=fatal jest", @@ -17,7 +17,7 @@ "test-dirty": "git diff --exit-code", "test": "npm run lint && npm run jest", "transpile": "rimraf dist && mkdirp dist && babel lib --out-dir dist", - "update-docs": "npm run transpile && bash bin/update-docs.sh", + "update-docs": "npm run build && bash bin/update-docs.sh", "semantic-release": "semantic-release pre && npm publish && semantic-release post" }, "repository": {