This repository has been archived by the owner on Sep 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathconfig.example.js
98 lines (97 loc) · 3.04 KB
/
config.example.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
/**
* This file is just an example of the config you need to provide, none of the values present here are real
*/
module.exports = {
name: 'MyName Landkid',
key: 'myname-landkid',
baseUrl: 'https://myname-landkid.ngrok.io',
port: process.env.SERVER_PORT ? Number(process.env.SERVER_PORT) : 8080,
landkidAdmins: ['your bb uuid'],
repoConfig: {
repoOwner: 'bitbucket workspace (e.g. bb username)',
repoName: 'myname-landkid-test-repo',
uuid: 'repo uuid', // This is optional but will make development startup faster
},
deployment: {
secret: 'session secret', // for local dev this can be anything
redis: {
endpoint: process.env.REDIS_SESSION_HOST,
port: process.env.REDIS_SESSION_PORT,
},
// Create oauth consumer for workspace
// Needs to be private with callback URL as baseUrl/auth/callback and URL set to baseUrl
// Requires account read permissions
oAuth: {
key: process.env.oauth_key,
secret: process.env.oauth_secret,
},
enableBasicAuth: false,
},
maxConcurrentBuilds: 3,
widgetSettings: {
refreshInterval: 10000,
refreshOnlyWhenInViewport: false,
enableSquashMerge: false,
},
prSettings: {
requiredApprovals: 0,
canApproveOwnPullRequest: true,
requireClosedTasks: true,
requireGreenBuild: false,
allowLandWhenAble: true,
landBuildTimeoutTime: 1000 * 60 * 60 * 2, // 2 hours
/** What is provided to a custom rule:
* {
* pullRequest: BB.PullRequest -- see /src/bitbucket/types.d.ts
* buildStatuses: BB.BuildStatus[] -- see /src/bitbucket/types.d.ts
* approvals: string[] -- usernames of all real approvals
* permissionLevel: "read" | "land" | "admin" -- permission level of the user requesting /can-land
* }
* Return true if the rule is passed and is not blocking landing,
* otherwise return the error message to be displayed on the PR
*/
},
mergeSettings: {
skipBuildOnDependentsAwaitingMerge: true,
mergeBlocking: {
enabled: false,
builds: [
{
targetBranch: 'master',
pipelineFilterFn: (pipelines) => {
return (
pipelines
.filter(
(pipeline) =>
pipeline.state.name === 'IN_PROGRESS' || pipeline.state.name === 'PENDING',
)
// Filter to only default builds run on 'push'.
// Allow manual trigger of default builds but exclude custom builds that are triggered manually
.filter(
(job) => job.trigger.name !== 'SCHEDULE' && job.target.selector.type !== 'custom',
)
);
},
},
],
},
},
queueSettings: {
speculationEngineEnabled: false,
},
eventListeners: [
{
event: 'PULL_REQUEST.MERGE.SUCCESS',
listener: ({
landRequestId,
pullRequestId,
sourceBranch,
targetBranch,
commit,
duration,
}) => {
// send data to metrics tooling
},
},
],
};