Skip to content

Commit d39e78c

Browse files
Codefresh report image (#486)
* initial commit * finalizing * make public * add workdir and title to examples * Change description of jira and container integration to make it clear it references GitOps side Signed-off-by: Laurent <[email protected]> * Removing CF_CI_TYPE as a patmeter and forcing it to classic Signed-off-by: Laurent <[email protected]> * Removing CF_WORKFLOW_URL as a parameter and forcing it to classic Signed-off-by: Laurent <[email protected]> Co-authored-by: Laurent <[email protected]>
1 parent d23a436 commit d39e78c

File tree

3 files changed

+230
-0
lines changed

3 files changed

+230
-0
lines changed
Lines changed: 15 additions & 0 deletions
Loading
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Codefresh
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
kind: step-type
2+
version: '1.0'
3+
metadata:
4+
name: codefresh-report-image
5+
version: 1.0.0
6+
isPublic: true
7+
description: Report Docker Image Metadata to Codefresh CD
8+
sources:
9+
- https://github.com/codefresh-io/steps/tree/master/incubating/codefresh-report-image
10+
stage: incubating
11+
maintainers:
12+
- name: Dustin Van Buskirk
13+
14+
categories:
15+
- utilities
16+
official: true
17+
tags: []
18+
icon:
19+
type: svg
20+
url: https://raw.githubusercontent.com/codefresh-io/steps/master/incubating/codefresh-report-image/Codefresh_Logo_Vertical_LightBkgd.svg
21+
background: "#f4f4f4"
22+
examples:
23+
- description: report-image-metadata
24+
workflow:
25+
ReportImageMetadata:
26+
title: Report image to Codefresh CD
27+
type: codefresh-report-image
28+
working_directory: /code
29+
arguments:
30+
CF_API_KEY: codefresh-cd-api-token
31+
CF_IMAGE: docker.io/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}:${{CF_REVISION}}
32+
CF_HOST: https://codefresh.mydomain.com
33+
- description: report-image-metadata-all
34+
workflow:
35+
ReportImageMetadataAll:
36+
title: Report image to Codefresh CD
37+
type: codefresh-report-image
38+
working_directory: /code
39+
arguments:
40+
CF_API_KEY: codefresh-cd-api-token
41+
CF_IMAGE: docker.io/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}:${{CF_REVISION}}
42+
CF_HOST: https://codefresh.mydomain.com
43+
CF_ENRICHERS: jira, git
44+
CF_GITHUB_TOKEN: ${{GITHUB_TOKEN}}
45+
CF_GIT_PROVIDER: github
46+
CF_GIT_REPO: ${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}
47+
CF_GIT_BRANCH: ${{CF_BRANCH}}
48+
CF_JIRA_API_TOKEN: ${{JIRA_TOKEN}}
49+
CF_JIRA_EMAIL: [email protected]
50+
CF_JIRA_HOST_URL: https://codefresh-io.atlassian.net
51+
CF_JIRA_MESSAGE: ${{CF_COMMIT_MESSAGE}}
52+
CF_JIRA_PROJECT_PREFIX: SA
53+
spec:
54+
arguments: |-
55+
{
56+
"definitions": {},
57+
"$schema": "http://json-schema.org/draft-07/schema#",
58+
"type": "object",
59+
"additionalProperties": true,
60+
"patterns": [],
61+
"required": [
62+
"CF_API_KEY",
63+
"CF_IMAGE",
64+
"CF_HOST"
65+
],
66+
"properties": {
67+
"CF_API_KEY": {
68+
"type": "string",
69+
"description": "API Key from Codefresh CD platform."
70+
},
71+
"CF_CONTAINER_REGISTRY_INTEGRATION": {
72+
"type": "string",
73+
"description": "Codefresh Gitops Registry integration name."
74+
},
75+
"CF_DOCKERHUB_PASSWORD": {
76+
"type": "string",
77+
"description": "When no registry integration is specified: dockerhub token as password."
78+
},
79+
"CF_DOCKERHUB_USERNAME": {
80+
"type": "string",
81+
"description": "When no registry integration is specified: dockerhub username."
82+
},
83+
"CF_ENRICHERS": {
84+
"type": "string",
85+
"description": "Comma delimited list of integrations for collecting metadata on the build image/"
86+
},
87+
"CF_GIT_BRANCH": {
88+
"type": "string",
89+
"description": "The git branch which is related for the commit."
90+
},
91+
"CF_GIT_PROVIDER": {
92+
"type": "string",
93+
"description": "The git integration type use (i.e. github)"
94+
},
95+
"CF_GIT_REPO": {
96+
"type": "string",
97+
"description": "The the git repository used for building the image."
98+
},
99+
"CF_GITHUB_API_URL": {
100+
"type": "string",
101+
"description": "Specify github host api url.",
102+
"default": "https://api.github.com"
103+
},
104+
"CF_GITHUB_TOKEN": {
105+
"type": "string",
106+
"description": "Github personal access token. Scope: repo."
107+
},
108+
"CF_HOST": {
109+
"type": "string",
110+
"description": "Codefresh Runtime Ingress URL. (ie. https://codefresh.mycompany.com)"
111+
},
112+
"CF_JIRA_API_TOKEN": {
113+
"type": "string",
114+
"description": "When no jira integration is specified: Jira token for authenticating."
115+
},
116+
"CF_IMAGE": {
117+
"type": "string",
118+
"description": "Fully qualified image name to be reported to Codefresh CD. (i.e. docker.io/codefresh/example-app:1.0.0)"
119+
},
120+
"CF_JIRA_EMAIL": {
121+
"type": "string",
122+
"description": "When no jira integration is specified: user email for authenticating with jira."
123+
},
124+
"CF_JIRA_FAIL_ON_NOT_FOUND": {
125+
"type": "string",
126+
"description": "Fail pipeline if 'issue' not found."
127+
},
128+
"CF_JIRA_INTEGRATION": {
129+
"type": "string",
130+
"description": "When Codefresh GitOps jira integration name is specified instead of providing explicit credentials."
131+
},
132+
"CF_JIRA_HOST_URL": {
133+
"type": "string",
134+
"description": "When no jira integration is specified: The jira server url. (i.e. https://codefresh-io.atlassian.net/)"
135+
},
136+
"CF_JIRA_MESSAGE": {
137+
"type": "string",
138+
"description": "The message to parse for JIRA ticket. (i.e. fix SA-45)"
139+
},
140+
"CF_JIRA_PROJECT_PREFIX": {
141+
"type": "string",
142+
"description": "Jira prefix for identifying the ticket number to use. (i.e. CR)"
143+
},
144+
"CF_REGISTRY_DOMAIN": {
145+
"type": "string",
146+
"description": "When no registry integration is specified: registry domain."
147+
},
148+
"CF_REGISTRY_INSECURE": {
149+
"type": "boolean",
150+
"description": "All insecure registry."
151+
},
152+
"CF_REGISTRY_PASSWORD": {
153+
"type": "string",
154+
"description": "When no registry integration is specified: registry token/password."
155+
},
156+
"CF_REGISTRY_USERNAME": {
157+
"type": "string",
158+
"description": "When no registry integration is specified: registry username."
159+
},
160+
"CF_WORKFLOW_NAME": {
161+
"type": "string",
162+
"description": "Given workflow name parameter."
163+
},
164+
"REGISTRY": {
165+
"type": "string",
166+
"description": "Docker Registry for step's image.",
167+
"default": "quay.io"
168+
},
169+
"IMAGE": {
170+
"type": "string",
171+
"description": "Image name for step's image.",
172+
"default": "codefresh/codefresh-report-image"
173+
},
174+
"IMAGE_TAG": {
175+
"type": "string",
176+
"description": "Image tag for step's image.",
177+
"default": "0.0.83"
178+
}
179+
}
180+
}
181+
stepsTemplate: |-
182+
codefresh-report-image:
183+
name: codefresh-report-image
184+
image: '[[.Arguments.REGISTRY]]/[[.Arguments.IMAGE]]:[[.Arguments.IMAGE_TAG]]'
185+
working_directory: /code
186+
environment:
187+
- CF_CI_TYPE=classic
188+
- CF_WORKFLOW_URL=${{CF_BUILD_URL}}
189+
[[ range $key, $val := .Arguments ]]
190+
- '[[ $key ]]=[[ $val ]]'
191+
[[- end ]]
192+
delimiters:
193+
left: '[['
194+
right: ']]'

0 commit comments

Comments
 (0)