forked from atlassian-archive/landkid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.example.js
66 lines (65 loc) · 2.05 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
/**
* 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,
},
},
maxConcurrentBuilds: 3,
prSettings: {
requiredApprovals: 0,
canApproveOwnPullRequest: true,
requireClosedTasks: true,
requireGreenBuild: false,
allowLandWhenAble: true,
/** 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: false,
},
eventListeners: [
{
event: 'PULL_REQUEST.MERGE.SUCCESS',
listener: ({
landRequestId,
pullRequestId,
sourceBranch,
targetBranch,
commit,
duration,
}) => {
// send data to metrics tooling
},
},
],
};