-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmanifest.js
172 lines (160 loc) · 3.84 KB
/
manifest.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
function addTaskToContribution(
contributions,
taskId,
taskName,
taskDescription
) {
contributions.push({
id: taskId,
description: taskDescription,
type: "ms.vss-distributed-task.task",
targets: ["ms.vss-distributed-task.tasks"],
properties: {
name: taskName,
},
});
}
function addPathToFileContributions(
fileContributions,
depPath,
taskPath,
packagedTaskPath
) {
if (packagedTaskPath == undefined || packagedTaskPath === "") {
packagedTaskPath = taskPath;
}
taskObj = {
path: taskPath,
packagePath: packagedTaskPath,
};
fileContributions.push(
{
path: depPath,
packagePath: packagedTaskPath,
},
taskObj
);
}
module.exports = (env) => {
let [idPostfix, namePostfix, isPublic] =
env.mode == "development" ? ["-dev", " [DEV]", false] : ["", "", true];
if (!env.version) {
throw new Error("No version found in environment, please check your environment definition!")
}
let version = env.version;
let manifest = {
manifestVersion: 1,
id: `cloud-automation-integration${idPostfix}`,
version: version,
name: `Cloud Automation Integration ${namePostfix}`,
description:
"Integration of Cloud Automation powered by Keptn within your build or release pipeline.",
publisher: "dynatrace",
public: isPublic,
targets: [
{
id: "Microsoft.VisualStudio.Services",
},
],
icons: {
default: "images/logo.png",
},
scopes: ["vso.build_execute", "vso.release_execute"],
categories: ["Azure Pipelines"],
content: {
details: {
path: "README.md",
},
},
repository: {
type: "git",
uri: "https://github.com/keptn-sandbox/keptn-azure-devops-extension",
},
contributions: [
{
id: "service-endpoint",
description: "Service Endpoint type for Keptn",
type: "ms.vss-endpoint.service-endpoint-type",
targets: ["ms.vss-endpoint.endpoint-types"],
properties: {
name: "Keptn-Api-Endpoint",
displayName: "Keptn",
url: {
displayName: "Keptn API Url",
helpText: "Url pointing to the Keptn REST API.",
},
authenticationSchemes: [
{
type: "ms.vss-endpoint.endpoint-auth-scheme-token",
},
],
helpMarkDown:
'<a href="https://github.com/keptn-sandbox/keptn-azure-devops-extension" target="_blank"><b>Learn More</b></a>',
},
},
],
files: [
{
path: "images",
addressable: true,
},
{
path: "screenshots",
addressable: true,
},
{
path: "FEATURES.md",
addressable: true,
},
{
path: "CHANGELOG.md",
addressable: true
},
],
};
addTaskToContribution(
manifest.contributions,
"add-keptn-resource",
"AddKeptnResourceTask",
"Add a resource to Keptn"
);
addPathToFileContributions(
manifest.files,
"dist",
"AddKeptnResourceTask/AddKeptnResourceTaskV1"
);
addTaskToContribution(
manifest.contributions,
"prep-keptn-env",
"SetupKeptnProjectTask",
"Setup Keptn project environment"
);
addPathToFileContributions(
manifest.files,
"dist",
"SetupKeptnProjectTask/SetupKeptnProjectTaskV2"
);
addTaskToContribution(
manifest.contributions,
"send-keptn-event",
"SendKeptnEventTask",
"Send an event to Keptn"
);
addPathToFileContributions(
manifest.files,
"dist",
"SendKeptnEventTask/SendKeptnEventTaskV3"
);
addTaskToContribution(
manifest.contributions,
"waitfor-keptn-event",
"WaitForKeptnEventTask",
"Wait for a Keptn event"
);
addPathToFileContributions(
manifest.files,
"dist",
"WaitForKeptnEventTask/WaitForKeptnEventTaskV2"
);
return manifest;
};