Skip to content

Commit fc2f66c

Browse files
Saas run annotations (#352)
1 parent 67f3bab commit fc2f66c

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM golang:alpine as go
33
RUN apk add --update ca-certificates git
44
RUN go get github.com/github/hub
55

6-
FROM node:9.2.0-alpine
6+
FROM node:9.10.0-alpine
77

88
RUN apk add --update ca-certificates git curl jq py-pip bash && pip install yq
99
COPY --from=go /go/bin/hub /usr/local/bin/hub

lib/interface/cli/commands/pipeline/run.base.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ class RunBaseCommand {
2525
const trigger = this.argv['trigger'];
2626
const only = this.argv['only'];
2727
const skip = this.argv['skip'];
28+
if (process.env.CF_BUILD_ID) {
29+
this.argv.annotation.push(`cf_predecessor=${process.env.CF_BUILD_ID}`);
30+
}
31+
const annotations = prepareKeyValueFromCLIEnvOption(this.argv.annotation);
32+
33+
2834

2935
const executionRequestTemplate = {
3036
pipelineName,
@@ -38,7 +44,9 @@ class RunBaseCommand {
3844
noCfCache,
3945
trigger,
4046
only,
41-
skip
47+
skip,
48+
annotations,
49+
4250
},
4351
};
4452
if (variablesFromFile) {

lib/interface/cli/commands/pipeline/run.cf.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ function _buildBody(data) {
2727
body.options.resetVolume = data.resetVolume;
2828
}
2929

30+
if (data.annotations) {
31+
body.annotations = data.annotations;
32+
}
33+
3034
if (data.sha) {
3135
body.sha = data.sha;
3236
}

lib/interface/cli/commands/pipeline/run.cmd.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ const run = new Command({
4343
alias: 'nc',
4444
default: false,
4545
})
46+
.option('annotation', {
47+
describe: 'Add annotations to created build',
48+
default: [],
49+
alias: 'a',
50+
51+
})
4652
.option('enable-notifications', {
4753
describe: 'Report notifications about pipeline execution',
4854
alias: 'en',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codefresh",
3-
"version": "0.29.0",
3+
"version": "0.30.0",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,

0 commit comments

Comments
 (0)