Skip to content

Commit c1615c3

Browse files
Add app-proxy prefix (#29)
Co-authored-by: saffi <[email protected]>
1 parent 78a110e commit c1615c3

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ Report created image to CSDP, for CI tools use.
44
* CF_API_KEY
55
* CF_IMAGE
66
## Required with Default
7-
* CF_HOST: app-proxy.yourcluster.io:8080
8-
* default: g.codefresh.io
7+
* CF_HOST: yourcluster.company.io
98
* CF_ENRICHERS: git, jira
109
* default is empty
1110
* possible values several of: git, jira
@@ -20,9 +19,8 @@ Report created image to CSDP, for CI tools use.
2019
* CF_GIT_BRANCH:
2120
* CF_GIT_SHA:
2221
* CF_GIT_REPO:
23-
* CF_GIT_INTEGRATION:
2422
### optional section Jira - specify if included in CF_ENRICHERS list
2523
* CF_JIRA_PROJECT_PREFIX: "CR"
2624
* CF_JIRA_MESSAGE: "${{ GIT_BRANCH }}"
2725
* CF_JIRA_INTEGRATION: "jira-1"
28-
* CF_JIRA_FAIL_ON_NOT_FOUND : ""
26+
* CF_JIRA_FAIL_ON_NOT_FOUND : "true"

action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ inputs:
44
VERSION:
55
description: specify client version
66
required: false
7-
default: 0.0.33
7+
default: 0.0.40
88
CF_API_KEY:
99
description: "Codefresh API KEY"
1010
required: true

service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
name: csdp-report-image
2-
version: 0.0.33
2+
version: 0.0.40

src/__tests__/request-builder.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ describe('request builder test', () => {
66
const
77
{ url, headers } = buildUrlHeaders({
88
'CF_API_KEY': 'the-token',
9-
'CF_HOST': 'g.codefresh.io',
9+
'CF_HOST': 'https://g.codefresh.io',
1010
'CF_IMAGE': 'testImage'
1111
})
12-
expect(url).toEqual('g.codefresh.io/api/image-report?CF_IMAGE=testImage')
12+
expect(url).toEqual('https://g.codefresh.io/app-proxy/api/image-report?CF_IMAGE=testImage')
1313
expect(headers).toEqual({ 'authorization': 'the-token' })
1414
})
1515

src/request-builder.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ export function buildUrlHeaders(payload: Record<string, string | undefined>) {
99
delete payload['CF_API_KEY']
1010
delete payload['CF_HOST']
1111
const qs = Object.entries(payload).map(kv => `${esc(kv[0])}=${esc(kv[1] || '')}`).join('&')
12-
const url = `${host}/api/image-report?${qs}`
12+
const url = `${host}/app-proxy/api/image-report?${qs}`
13+
if (payload['CF_LOCAL']) {
14+
return { url: `${host}/api/image-report?${qs}`, headers }
15+
}
1316
return { url, headers }
1417
}

0 commit comments

Comments
 (0)