screwdriver-api 7.0.109 → 7.0.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Dockerfile +4 -5
- package/Dockerfile.local +6 -1
- package/package.json +1 -1
- package/plugins/pipelines/README.md +10 -3
- package/plugins/pipelines/listEvents.js +19 -6
package/Dockerfile
CHANGED
|
@@ -21,11 +21,10 @@ RUN ln -s /usr/src/app/node_modules/screwdriver-api/config /config
|
|
|
21
21
|
# Expose the web service port
|
|
22
22
|
EXPOSE 8080
|
|
23
23
|
|
|
24
|
-
# Add
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
ENTRYPOINT ["/tini", "--"]
|
|
24
|
+
# Add dumb-init
|
|
25
|
+
RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64
|
|
26
|
+
RUN chmod +x /usr/local/bin/dumb-init
|
|
27
|
+
ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]
|
|
29
28
|
|
|
30
29
|
# Run the service
|
|
31
30
|
CMD [ "node", "./bin/server" ]
|
package/Dockerfile.local
CHANGED
|
@@ -14,5 +14,10 @@ COPY . /usr/src/app
|
|
|
14
14
|
# Expose the web service port
|
|
15
15
|
EXPOSE 8080
|
|
16
16
|
|
|
17
|
+
# Add dumb-init
|
|
18
|
+
RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64
|
|
19
|
+
RUN chmod +x /usr/local/bin/dumb-init
|
|
20
|
+
ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]
|
|
21
|
+
|
|
17
22
|
# Run the service
|
|
18
|
-
CMD [ "
|
|
23
|
+
CMD [ "node", "./bin/server" ]
|
package/package.json
CHANGED
|
@@ -101,10 +101,17 @@ Example payload:
|
|
|
101
101
|
`POST /pipelines/{id}/sync/pullrequests`
|
|
102
102
|
|
|
103
103
|
#### Get all pipeline events
|
|
104
|
-
`page`, `count`, `sort`, and `prNum` are optional
|
|
105
|
-
Only PR events of specified PR number will be searched when `prNum` is set
|
|
106
104
|
|
|
107
|
-
|
|
105
|
+
Query Params:
|
|
106
|
+
|
|
107
|
+
* `page` - *Optional* Specific page of the set to return
|
|
108
|
+
* `count` - *Optional* Number of items per page
|
|
109
|
+
* `sort` - *Optional* Sort rangekey by `ascending` or `descending` (default `descending`)
|
|
110
|
+
* `type` - *Optional* Get pipeline or pr events (default `pipeline`)
|
|
111
|
+
* `prNum` - *Optional* Return only PR events of specified PR number
|
|
112
|
+
* `sha` - *Optional* Search `sha` and `configPipelineSha` for events
|
|
113
|
+
|
|
114
|
+
`GET /pipelines/{id}/events?page={pageNumber}&count={countNumber}&sort={sort}&type={type}&prNum={prNumber}&sha={sha}`
|
|
108
115
|
|
|
109
116
|
#### Get all pipeline builds
|
|
110
117
|
`page`, `count`, `sort`, `latest`, `sortBy`, `fetchSteps`, `readOnly`, and `groupEventId` are optional
|
|
@@ -5,6 +5,8 @@ const joi = require('joi');
|
|
|
5
5
|
const schema = require('screwdriver-data-schema');
|
|
6
6
|
const eventListSchema = joi.array().items(schema.models.event.get).label('List of events');
|
|
7
7
|
const prNumSchema = schema.models.event.base.extract('prNum');
|
|
8
|
+
const shaSchema = schema.models.event.base.extract('sha');
|
|
9
|
+
const typeSchema = schema.models.event.base.extract('type');
|
|
8
10
|
const pipelineIdSchema = schema.models.pipeline.base.extract('id');
|
|
9
11
|
|
|
10
12
|
module.exports = () => ({
|
|
@@ -21,6 +23,7 @@ module.exports = () => ({
|
|
|
21
23
|
|
|
22
24
|
handler: async (request, h) => {
|
|
23
25
|
const factory = request.server.app.pipelineFactory;
|
|
26
|
+
const { page, count, sha, prNum } = request.query;
|
|
24
27
|
|
|
25
28
|
return factory
|
|
26
29
|
.get(request.params.id)
|
|
@@ -32,16 +35,25 @@ module.exports = () => ({
|
|
|
32
35
|
const eventType = request.query.type || 'pipeline';
|
|
33
36
|
const config = { params: { type: eventType } };
|
|
34
37
|
|
|
35
|
-
if (
|
|
38
|
+
if (page || count) {
|
|
36
39
|
config.paginate = {
|
|
37
|
-
page
|
|
38
|
-
count
|
|
40
|
+
page,
|
|
41
|
+
count
|
|
39
42
|
};
|
|
40
43
|
}
|
|
41
44
|
|
|
42
|
-
if (
|
|
45
|
+
if (prNum) {
|
|
43
46
|
config.params.type = 'pr';
|
|
44
|
-
config.params.prNum =
|
|
47
|
+
config.params.prNum = prNum;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (sha) {
|
|
51
|
+
config.search = {
|
|
52
|
+
field: ['sha', 'configPipelineSha'],
|
|
53
|
+
// Do a search for sha
|
|
54
|
+
// See https://www.w3schools.com/sql/sql_like.asp for syntax
|
|
55
|
+
keyword: `${sha}%`
|
|
56
|
+
};
|
|
45
57
|
}
|
|
46
58
|
|
|
47
59
|
return pipeline.getEvents(config);
|
|
@@ -60,8 +72,9 @@ module.exports = () => ({
|
|
|
60
72
|
}),
|
|
61
73
|
query: schema.api.pagination.concat(
|
|
62
74
|
joi.object({
|
|
63
|
-
type:
|
|
75
|
+
type: typeSchema,
|
|
64
76
|
prNum: prNumSchema,
|
|
77
|
+
sha: shaSchema,
|
|
65
78
|
search: joi.forbidden(), // we don't support search for Pipeline list events
|
|
66
79
|
getCount: joi.forbidden() // we don't support getCount for Pipeline list events
|
|
67
80
|
})
|