-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrenovate-global-config.js
125 lines (124 loc) · 4.69 KB
/
renovate-global-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
const apaxNpmrc = process.env.RENOVATE_NPMRC;
const prFooter = `:space_invader: :sparkles: This merge request is proudly presented by [Renovate Bot](https://code.siemens.com/ax/devops/renovate-bot).`;
module.exports = {
platform: "github",
groupName: "all",
separateMajorMinor: false,
gitAuthor: "simatic-ax-bot <[email protected]>",
prFooter: prFooter,
requireConfig: "required",
autodiscoverFilter: process.env.RENOVATE_AUTODISCOVERFILTER, //
autodiscover: true,
allowPostUpgradeCommandTemplating: true,
allowedPostUpgradeCommands: [".+"],
logFile: process.env.LOG_FILE,
logFileLevel: process.env.LOG_FILE_LEVEL || "trace",
cacheDir: process.env.CACHE_DIR,
allowScripts: true,
exposeAllEnv: true,
ignoreScripts: true,
npmrc: process.env.RENOVATE_NPMRC,
labels: ["renovate"],
hostRules: [
{
hostType: "npm",
matchHost: "registry.simatic-ax.siemens.io",
token: process.env.RENOVATE_APAX_TOKEN,
},
],
regexManagers: [
{
fileMatch: ["(^|\\/)(test.|test-windows.)?apax.ya?ml$"],
matchStrings: [
// We're using `String.raw` here so that the RegEx can be easily copied from/to other tools (e.g. https://regex101.com/)
String.raw`"(?<depName>@ax\/.*?)"\s*:\s*"?(?<currentValue>[\d\.^\-\w]*)"?`,
],
datasourceTemplate: "npm",
// Unfortunately setting the registryUrl here does not work properly.
// The registry can only be set via the `npmrc` property in the package rules.
// Seems to be an NPM-specific weird behavior of Renovate, maybe related to
// https://github.com/renovatebot/renovate/issues/4224
// registryUrlTemplate: "https://axciteme.siemens.com/registry/apax/"
},
{
fileMatch: ["(^|\\/)(test.|test-windows.)?apax.ya?ml$"],
matchStrings: [
// We're using `String.raw` here so that the RegEx can be easily copied from/to other tools (e.g. https://regex101.com/)
String.raw`#\s*renovate:\s+datasource=(?<datasource>.*?)\s+depName=(?<depName>[\.\w]+)[\s-]+[\w]+_VERSION\s*=\s*"?(?<currentValue>[\d\.^\-\w]*)"?`,
],
},
],
packageRules: [
{
// Set endpoint and credentials for the Apax registry
matchPaths: ["**/{test.,test-windows.,}apax.y{a,}ml"],
npmrc: apaxNpmrc,
},
{
// Ensure lock files are updated
matchPaths: ["**/apax.y{a,}ml"],
postUpgradeTasks: {
// Switch to the directory of the apax.yml and update the lock file if it exists.
commands: [
`
cd ./{{{packageFileDir}}} &&
if test -f apax-lock.json; then
if apax install; then
echo Successfully updated lock file.
else
echo Failed to update lock file.
fi
else
echo No lock file to update.
fi
`,
],
fileFilters: ["**/apax-lock.json"],
},
},
{
// Ensure lock files are updated
matchPaths: ["**/apax.y{a,}ml"],
postUpgradeTasks: {
// Switch to the directory of the apax.yml and update the lock file if it exists.
commands: [
`
cd "./{{{packageFileDir}}}" &&
if test -f apax-lock.json; then
if apax install --ignore-scripts; then
echo Failed to update lock file.
else
echo Successfully updated lock file.
fi
else
echo No lock file to update.
fi
`,
],
fileFilters: ["**/apax-lock.json"],
},
},
{
"matchDatasources": ["docker"],
"groupName": "all container images",
"matchUpdateTypes": ["major", "minor", "patch", "pin", "pinDigest", "digest", "lockFileMaintenance", "rollback", "bump"]
},
{
"matchPackagePatterns": ["^@{0,1}[Aa][Xx]"],
"groupName": "AX Product Dependencies",
"matchUpdateTypes": ["major", "minor", "patch", "pin", "pinDigest", "digest", "lockFileMaintenance", "rollback", "bump"],
},
{
// splite SDK out that it doesn't follow the rules regarding breaking changes and version number assignment
"matchPackagePatterns": ["^@{0,1}[Aa][Xx]/[Ss][Dd][Kk]"],
"groupName": "AX Product SDK",
"matchUpdateTypes": ["major", "minor", "patch", "pin", "pinDigest", "digest", "lockFileMaintenance", "rollback", "bump"],
},
{
// ax simatic dependencies separated because of breaking changes
"matchPackagePatterns": ["^@{0,1}[Ss][Ii][Mm][Aa][Tt][Ii][Cc]-[Aa][Xx]"],
"groupName": "AX Github Comunity",
"matchUpdateTypes": ["major", "minor", "patch", "pin", "pinDigest", "digest", "lockFileMaintenance", "rollback", "bump"],
}
],
};