Skip to content

Commit 7f92432

Browse files
restore codefresh-csdp 1.0.1 (#530)
1 parent 330e1f5 commit 7f92432

File tree

12 files changed

+652
-6
lines changed

12 files changed

+652
-6
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# CSDP-metadata
2+
3+
## Summary
4+
5+
A set of templates to operate against Codefresh Software Delivery Platform such as reporting image information to the Argo platform, and enriching images with metadata and annotation for GitHub (PRs, commits, etc) and Jira (title, assignee, etc).
6+
7+
## Templates
8+
9+
1. [image-enricher-git-info](https://github.com/codefresh-io/argo-hub/blob/main/workflows/codefresh-csdp/versions/1.0.0/docs/image-enricher-git-info.md)
10+
2. [image-enricher-jira-info](https://github.com/codefresh-io/argo-hub/blob/main/workflows/codefresh-csdp/versions/1.0.0/docs/image-enricher-jira-info.md)
11+
3. [report-image-info](https://github.com/codefresh-io/argo-hub/blob/main/workflows/codefresh-csdp/versions/1.0.0/docs/report-image-info.md)
12+
13+
## Security
14+
15+
Minimal required permissions
16+
17+
[Full rbac permissions list](https://github.com/codefresh-io/argo-hub/blob/main/workflows/codefresh-csp/versions/1.0.0/rbac.yaml)
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# image-enricher-git-info
2+
3+
## Summary
4+
Enrich images with metadata and annotation such as PR, commits, committers.
5+
6+
## Inputs/Outputs
7+
8+
### Inputs
9+
* IMAGE_NAME (required) - The image name that was imported into Codefresh to enrich
10+
* IMAGE_SHA (required) - The image sha that was imported into Codefresh to enrich
11+
* GIT_PROVIDER (required) - One of the supported git providers: github
12+
* BRANCH (required) - The git branch to use to enrich
13+
* REPO (required) - The repo to use to enrich
14+
* CF_API_KEY (required) - The Kubernetes secret containing the Codefresh API key
15+
* CF_API_KEY_SECRET_KEY (optional) - The key in the Kubernetes secret that has the Codefresh API Key. Default is 'token'
16+
* CF_HOST_URL (optional) - The URL to reach Codefresh (support on-premises Codefresh). Default is 'https://g.codefresh.io'
17+
* GITHUB_API_HOST_URL (optional) - The URL to reach the GitHub API (support on-premises GitHub api). Default is 'https://api.github.com'
18+
* GITHUB_API_PATH_PREFIX (optional) - The API prefix path for GitHub (support on-premises GitHub path prefix).
19+
* GITHUB_TOKEN_SECRET_NAME (optional) - The Kubernetes secret containing the GitHub token
20+
* GITHUB_TOKEN_SECRET_KEY (optional) - The key in the Kubernetes secret containing the GitHub token. Default is 'token'
21+
* GITHUB_CONTEXT (optional) - The name of the github context from classic codefresh platform
22+
* GITLAB_HOST_URL (optional) - The Kubernetes secret containing the GitHub token
23+
* GITLAB_TOKEN_SECRET_NAME (optional) - The Kubernetes secret containing the GitHub token
24+
* GITLAB_TOKEN_SECRET_KEY (optional) - The key in the Kubernetes secret containing the GitHub token. Default is 'token'
25+
26+
27+
### Outputs
28+
no outputs
29+
30+
## Examples
31+
32+
### task Example
33+
```
34+
apiVersion: argoproj.io/v1alpha1
35+
kind: Workflow
36+
metadata:
37+
generateName: image-enricher-git-info-
38+
spec:
39+
entrypoint: main
40+
templates:
41+
- name: main
42+
dag:
43+
tasks:
44+
- name: image-enricher-git-info
45+
templateRef:
46+
name: argo-hub.codefresh-csdp.1.0.1
47+
template: image-enricher-git-info
48+
arguments:
49+
parameters:
50+
- name: CF_API_KEY
51+
value: 'codefresh-token'
52+
- name: CF_API_KEY_SECRET_KEY
53+
value: 'token'
54+
- name: IMAGE_NAME
55+
value: 'gcr.io/codefresh/cfstep-helm:lastest'
56+
- name: IMAGE_SHA
57+
value: 'sha256:cbe433136120cea1f146cf1b7f72e77fa763ff0c18b10ef605c1fc5c3d5fbec'
58+
- name: GIT_PROVIDER
59+
value: 'github'
60+
- name: REPO
61+
value: 'codefresh/cfstep-helm'
62+
- name: BRANCH
63+
value: 'main'
64+
- name: GITHUB_TOKEN_SECRET_NAME
65+
value: 'github-creds'
66+
- name: GITHUB_TOKEN_SECRET_KEY
67+
value: 'token'
68+
```
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# image-enricher-jira-info
2+
3+
## Summary
4+
Enrich images with metadata and annotation such as ticket number, title, assignee, status.
5+
6+
## Inputs/Outputs
7+
8+
### Inputs
9+
* IMAGE_NAME (required) - The image URI that was imported into Codefresh to enrich
10+
* JIRA_HOST_URL (required) - jira host url
11+
* JIRA_API_TOKEN_SECRET (required) - Name of Kubernetes secret that contains a jira email and token that you generate in jira
12+
* JIRA_API_TOKEN_SECRET_KEY (required) - The key in the Kubernetes secret with the Jira API token. Default is 'token'
13+
* JIRA_EMAIL_SECRET_KEY (required) - The key in the Kubernetes secret with the Jira Email associated with the API token. Default is 'email'
14+
* JIRA_MESSAGE (required) - message from which you want retrieve issue name, can be a branch, commit message, whatever
15+
* JIRA_PROJECT_PREFIX (required) - jira project prefix like: SAAS, CF, etc
16+
* CF_API_KEY (required) - The Kubernetes secret containing the Codefresh API key
17+
* CF_API_KEY_SECRET_KEY (optional) - The key in the Kubernetes secret that has the Codefresh API Key. Default is 'token'
18+
* CF_HOST_URL (optional) - The URL to reach Codefresh (support on-premises Codefresh). Default is 'https://g.codefresh.io'
19+
* JIRA_CONTEXT (optional) - The Jira context to use
20+
* FAIL_ON_NOT_FOUND (optional) - fail in case of ticket not found. Default is 'false'
21+
22+
### Outputs
23+
no outputs
24+
25+
## Examples
26+
27+
### task Example
28+
```
29+
apiVersion: argoproj.io/v1alpha1
30+
kind: Workflow
31+
metadata:
32+
generateName: image-enricher-jira-info-
33+
spec:
34+
entrypoint: main
35+
templates:
36+
- name: main
37+
dag:
38+
tasks:
39+
- name: image-enricher-jira-info
40+
templateRef:
41+
name: argo-hub.codefresh-csdp.1.0.1
42+
template: image-enricher-jira-info
43+
arguments:
44+
parameters:
45+
- name: CF_API_KEY
46+
value: 'codefresh-token'
47+
- name: CF_API_KEY_SECRET_KEY
48+
value: 'token'
49+
- name: IMAGE_NAME
50+
value: 'gcr.io/codefresh/cfstep-helm:lastest'
51+
- name: IMAGE_SHA
52+
value: 'sha256:b5fd0f2fe40fa240975abc4b1b7bf101d4cadcf296f51af799917bcaa76aeb4f'
53+
- name: JIRA_PROJECT_PREFIX
54+
value: 'CR'
55+
- name: JIRA_MESSAGE
56+
value: 'working on CR-11027'
57+
- name: JIRA_HOST_URL
58+
value: 'https://jira.atlassian.net'
59+
- name: JIRA_API_TOKEN_SECRET
60+
value: 'jira-creds'
61+
- name: JIRA_API_TOKEN_SECRET_KEY
62+
value: 'token'
63+
- name: JIRA_EMAIL_SECRET_KEY
64+
value: 'email'
65+
```
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# report-image-info
2+
3+
## Summary
4+
Report image info to argo platform.
5+
6+
## Inputs/Outputs
7+
8+
### Inputs
9+
* IMAGE_NAME (required) - your image to which you want to report
10+
* CF_API_KEY (required) - Codefresh API key created by runtime
11+
* CF_HOST_URL (optional) - support on-premises Codefresh URL
12+
* WORKFLOW_URL (optional) - external url for the workflow
13+
* LOGS_URL (optional) - external url for the logs
14+
* REGISTRY_INSECURE (optional) - security flag for standard registry protocol, when set to true it enables http protocol.
15+
* RETRIEVE_CREDENTIALS_BY_DOMAIN (optional) - decide about the authentication method based on the image domain
16+
#### Specify one from following required registry parameters:
17+
* GCR_KEY_FILE_PATH (required) - JSON key for authenticating to a Google GCR
18+
* GCR_KEY_SECRET (required) - The Kubernetes secret containing the GCR key information. Default is 'gcr-key-file'
19+
* GCR_KEY_SECRET_KEY (optional) - The key in the Kubernetes secret containing the GCR key information. Default is '.keyjson'
20+
* AWS_ACCESS_KEY (required) - The Kubernetes secret with the Amazon access key
21+
* AWS_ACCESS_KEY_SECRET_KEY (optional) - The key in the Kubernetes secret with the Amazon access key. Default is 'aws-access-key'
22+
* AWS_SECRET_KEY (required) - The Kubernetes secret with the Amazon secret key
23+
* AWS_SECRET_KEY_SECRET_KEY (optional) - The key in the Kubernetes secret with the Amazon secret key. Default is 'aws-secret-key'
24+
* AWS_REGION (required) - The Kubernetes secret with the Amazon region
25+
* AWS_REGION_SECRET_KEY (optional) - The key in the Kubernetes secret with the Amazon region. Default is 'aws-region'
26+
* DOCKER_CONFIG_FILE_PATH (required) - docker config json for authenticating to a registry (GCR, ECR, ACR not supported)
27+
* DOCKER_CONFIG_SECRET (required) - The Kubernetes secret containing the docker config json information. Default is 'docker-registry'
28+
* DOCKER_CONFIG_SECRET_KEY (optional) - The key in the Kubernetes secret containing the docker config json information. Default is '.dockerconfigjson'
29+
* DOCKERHUB_USERNAME (required) - The Kubernetes secret with the docker username
30+
* DOCKERHUB_USERNAME_SECRET_KEY (optional) The key in the Kubernetes secret with the docker username. Default is 'username'
31+
* DOCKERHUB_PASSWORD (required) - The Kubernetes secret with the docker password
32+
* DOCKERHUB_PASSWORD_SECRET_KEY (optional) The key in the Kubernetes secret with the docker password. Default is 'password'
33+
* REGISTRY_USERNAME (required) - The Kubernetes secret with the standard registry username
34+
* USERNAME_SECRET_KEY (optional) The key in the Kubernetes secret with the standard registry username. Default is 'username'
35+
* REGISTRY_PASSWORD (required) - The Kubernetes secret with the standard registry password
36+
* PASSWORD_SECRET_KEY (optional) The key in the Kubernetes secret with the standard registry password. Default is 'password'
37+
* REGISTRY_DOMAIN (required) - The Kubernetes secret with the standard registry domain
38+
* REGISTRY_DOMAIN_SECRET_KEY (optional) - The key in the Kubernetes secret with the standard registry domain. Default is 'domain'
39+
* AWS_ROLE_SECRET (required) - The Kubernetes secret with the Amazon role
40+
* AWS_ROLE_SECRET_KEY (optional) -The key in the Kubernetes secret with the standard Amazon role. Default is 'role'
41+
42+
### Outputs
43+
* `image-name` – name of the reported image
44+
* `image-sha` – SHA of the reported image
45+
46+
## Examples
47+
48+
### task Example
49+
```
50+
apiVersion: argoproj.io/v1alpha1
51+
kind: Workflow
52+
metadata:
53+
generateName: report-image-info-
54+
spec:
55+
entrypoint: main
56+
templates:
57+
- name: main
58+
dag:
59+
tasks:
60+
- name: report-image-info
61+
templateRef:
62+
name: argo-hub.codefresh-csdp.1.0.1
63+
template: report-image-info
64+
arguments:
65+
parameters:
66+
- name: CF_API_KEY
67+
value: 'codefresh-token'
68+
- name: CF_API_KEY_SECRET_KEY
69+
value: 'token'
70+
- name: IMAGE_NAME
71+
value: 'deniscodefresh/ppid-inspector:latest'
72+
- name: DOCKERHUB_USERNAME
73+
value: 'dockerhub-creds'
74+
- name: USERNAME_SECRET_KEY
75+
value: 'username'
76+
- name: DOCKERHUB_PASSWORD
77+
value: 'dockerhub-creds'
78+
- name: PASSWORD_SECRET_KEY
79+
value: 'password'
80+
```
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: argo-hub.codefresh-csdp.1.0.1
5+
annotations:
6+
argo-hub/version: '1.0.1'
7+
---
8+
apiVersion: rbac.authorization.k8s.io/v1
9+
kind: Role
10+
metadata:
11+
name: argo-hub.codefresh-csdp.1.0.1
12+
annotations:
13+
argo-hub/version: '1.0.1'
14+
rules:
15+
- apiGroups:
16+
- ""
17+
resources:
18+
- pods
19+
verbs:
20+
- get
21+
- watch
22+
- patch
23+
- apiGroups:
24+
- ""
25+
resources:
26+
- pods/log
27+
verbs:
28+
- get
29+
- watch
30+
---
31+
apiVersion: rbac.authorization.k8s.io/v1
32+
kind: RoleBinding
33+
metadata:
34+
name: argo-hub.codefresh-csdp.1.0.1
35+
annotations:
36+
argo-hub/version: '1.0.1'
37+
roleRef:
38+
apiGroup: rbac.authorization.k8s.io
39+
kind: Role
40+
name: argo-hub.codefresh-csdp.1.0.1
41+
subjects:
42+
- kind: ServiceAccount
43+
name: argo-hub.codefresh-csdp.1.0.1

0 commit comments

Comments
 (0)