Skip to content

Commit 10e130a

Browse files
updated axios, node.js (#563)
1 parent 45e57f3 commit 10e130a

File tree

33 files changed

+10804
-0
lines changed

33 files changed

+10804
-0
lines changed

workflows/codefresh-csdp/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
# Changelog
2+
## v1.1.13 (30.04.2025)
3+
### report-image-info
4+
* Security fixes.
5+
6+
## v1.1.12 (21.01.2025)
7+
### report-image-info
8+
* Security fixes.
29

310
## v1.1.11 (17.10.2024)
411
### report-image-info
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.1.13/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.1.13/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.1.13/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.1.13/rbac.yaml)
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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+
* GIT_PROVIDER (required) - One of the supported git providers: github, gitlab, bitbucket, bitbucket-server, gerrit
11+
* BRANCH (required with github, gitlab, bitbucket, bitbucket-server) - The git branch to use to enrich
12+
* REPO (required) - The repo to use to enrich
13+
* REVISION - The commit sha to use to enrich
14+
* GERRIT_CHANGE_ID (required with gerrit) - The change-id or a commit message that contain the change-id
15+
* CF_API_KEY (required) - The Kubernetes secret containing the Codefresh API key created by **runtime**
16+
* CF_API_KEY_SECRET_KEY (optional) - The key in the Kubernetes secret that has the Codefresh API key created by **runtime**. Default is 'token'
17+
* CF_HOST_URL (optional) - The URL to reach Codefresh (support on-premises Codefresh). Default is 'https://g.codefresh.io'
18+
* GITHUB_API_HOST_URL (optional) - The URL to reach the GitHub API (support on-premises GitHub api). Default is 'https://api.github.com'
19+
* GITHUB_API_PATH_PREFIX (optional) - The API prefix path for GitHub (support on-premises GitHub path prefix).
20+
* GITHUB_TOKEN_SECRET_NAME (optional) - The Kubernetes secret containing the GitHub token
21+
* GITHUB_TOKEN_SECRET_KEY (optional) - The key in the Kubernetes secret containing the GitHub token. Default is 'token'
22+
* GITHUB_CONTEXT (optional) - The name of the github context from classic codefresh platform
23+
* GITLAB_HOST_URL (optional) - The URL to reach the GitLab API (support on-premises GitLab api). Default is 'https://gitlab.com'
24+
* GITLAB_TOKEN_SECRET_NAME (optional) - The Kubernetes secret containing the GitLab token
25+
* GITLAB_TOKEN_SECRET_KEY (optional) - The key in the Kubernetes secret containing the GitLab token. Default is 'token'
26+
* BITBUCKET_HOST_URL (optional) - The URL to reach the BitBucket API (support on-premises BitBucket api). Default is 'https://api.bitbucket.org/2.0'
27+
* BITBUCKET_SECRET_NAME (optional) - The Kubernetes secret containing the BitBucket credentials
28+
* BITBUCKET_USERNAME_SECRET_KEY (optional) - The key in the Kubernetes secret containing the BitBucket username. Default is 'username'
29+
* BITBUCKET_PASSWORD_SECRET_KEY (optional) - The key in the Kubernetes secret containing the BitBucket password. Default is 'password'
30+
* GERRIT_HOST_URL (optional) - The URL to reach the Gerrit API
31+
* GERRIT_SECRET_NAME (optional) - The Kubernetes secret containing the Gerrit credentials
32+
* GERRIT_USERNAME_SECRET_KEY (optional) - The key in the Kubernetes secret containing the Gerrit username. Default is 'username'
33+
* GERRIT_PASSWORD_SECRET_KEY (optional) - The key in the Kubernetes secret containing the Gerrit password. Default is 'password'
34+
35+
### Outputs
36+
* `exit-error` – message of the error that caused template failure
37+
38+
## Examples
39+
40+
### task Example
41+
```
42+
apiVersion: argoproj.io/v1alpha1
43+
kind: Workflow
44+
metadata:
45+
generateName: image-enricher-git-info-
46+
spec:
47+
entrypoint: main
48+
templates:
49+
- name: main
50+
dag:
51+
tasks:
52+
- name: image-enricher-git-info
53+
templateRef:
54+
name: argo-hub.codefresh-csdp.1.1.13
55+
template: image-enricher-git-info
56+
arguments:
57+
parameters:
58+
- name: CF_API_KEY
59+
value: 'codefresh-token'
60+
- name: CF_API_KEY_SECRET_KEY
61+
value: 'token'
62+
- name: IMAGE_NAME
63+
value: 'gcr.io/codefresh/cfstep-helm:lastest'
64+
- name: GIT_PROVIDER
65+
value: 'github'
66+
- name: REPO
67+
value: 'codefresh/cfstep-helm'
68+
- name: BRANCH
69+
value: 'main'
70+
- name: REVISION
71+
value: 'ec8cdced58869a9cbd315a1297a702bbd744a9ed'
72+
- name: GITHUB_TOKEN_SECRET_NAME
73+
value: 'github-creds'
74+
- name: GITHUB_TOKEN_SECRET_KEY
75+
value: 'token'
76+
```
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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: /[A-Z]{2,}-\d+/g, SAAS, CF, etc.
16+
* CF_API_KEY (required) - The Kubernetes secret containing the Codefresh API key created by **runtime**
17+
* CF_API_KEY_SECRET_KEY (optional) - The key in the Kubernetes secret that has the Codefresh API key created by **runtime**. 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+
* `exit-error` – message of the error that caused template failure
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.1.13
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: JIRA_PROJECT_PREFIX
52+
value: 'CR'
53+
- name: JIRA_MESSAGE
54+
value: 'working on CR-11027'
55+
- name: JIRA_HOST_URL
56+
value: 'https://jira.atlassian.net'
57+
- name: JIRA_API_TOKEN_SECRET
58+
value: 'jira-creds'
59+
- name: JIRA_API_TOKEN_SECRET_KEY
60+
value: 'token'
61+
- name: JIRA_EMAIL_SECRET_KEY
62+
value: 'email'
63+
```
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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_NAME (optional) - name of the workflow
13+
* WORKFLOW_URL (optional) - external url of the workflow
14+
* LOGS_URL (optional) - external url of the workflow logs
15+
* REGISTRY_INSECURE (optional) - security flag for standard registry protocol, when set to true it enables http protocol.
16+
* RETRIEVE_CREDENTIALS_BY_DOMAIN (optional) - decide about the authentication method based on the image domain
17+
* DOCKERFILE_CONTENT (optional) - base64 encoded content of the Dockerfile used for building image
18+
* DOCKERFILE_PATH (optional) - path to the Dockerfile used for building image (used if DOCKERFILE_CONTENT is empty)
19+
#### Specify one from following required registry parameters:
20+
* GCR_KEY_FILE_PATH (required) - JSON key for authenticating to a Google GCR
21+
* GCR_KEY_SECRET (required) - The Kubernetes secret containing the GCR key information. Default is 'gcr-key-file'
22+
* GCR_KEY_SECRET_KEY (optional) - The key in the Kubernetes secret containing the GCR key information. Default is '.keyjson'
23+
* GOOGLE_REGISTRY_HOST (optional) - The host to Google GCR or Google ACR. Default is 'gcr.io'
24+
* GOOGLE_JSON_KEY (required) - The Kubernetes secret with the JSON key for authenticating to a Google GCR or Google ACR
25+
* GOOGLE_KEY_SECRET_KEY (optional) The key in the Kubernetes secret with Google JSON key. Default is 'keyjson'
26+
* AWS_ACCESS_KEY (required) - The Kubernetes secret with the Amazon access key
27+
* AWS_ACCESS_KEY_SECRET_KEY (optional) - The key in the Kubernetes secret with the Amazon access key. Default is 'aws-access-key'
28+
* AWS_SECRET_KEY (required) - The Kubernetes secret with the Amazon secret key
29+
* AWS_SECRET_KEY_SECRET_KEY (optional) - The key in the Kubernetes secret with the Amazon secret key. Default is 'aws-secret-key'
30+
* AWS_REGION (required) - The Kubernetes secret with the Amazon region
31+
* AWS_REGION_SECRET_KEY (optional) - The key in the Kubernetes secret with the Amazon region. Default is 'aws-region'
32+
* DOCKER_CONFIG_FILE_PATH (required) - docker config json for authenticating to a registry (GCR, ECR, ACR not supported)
33+
* DOCKER_CONFIG_SECRET (required) - The Kubernetes secret containing the docker config json information. Default is 'docker-registry'
34+
* DOCKER_CONFIG_SECRET_KEY (optional) - The key in the Kubernetes secret containing the docker config json information. Default is '.dockerconfigjson'
35+
* DOCKERHUB_USERNAME (required) - The Kubernetes secret with the docker username
36+
* DOCKERHUB_USERNAME_SECRET_KEY (optional) The key in the Kubernetes secret with the docker username. Default is 'username'
37+
* DOCKERHUB_PASSWORD (required) - The Kubernetes secret with the docker password
38+
* DOCKERHUB_PASSWORD_SECRET_KEY (optional) The key in the Kubernetes secret with the docker password. Default is 'password'
39+
* REGISTRY_USERNAME (required) - The Kubernetes secret with the standard registry username
40+
* USERNAME_SECRET_KEY (optional) The key in the Kubernetes secret with the standard registry username. Default is 'username'
41+
* REGISTRY_PASSWORD (required) - The Kubernetes secret with the standard registry password
42+
* PASSWORD_SECRET_KEY (optional) The key in the Kubernetes secret with the standard registry password. Default is 'password'
43+
* REGISTRY_DOMAIN (required) - The Kubernetes secret with the standard registry domain
44+
* REGISTRY_DOMAIN_SECRET_KEY (optional) - The key in the Kubernetes secret with the standard registry domain. Default is 'domain'
45+
* AWS_ROLE_SECRET (required) - The Kubernetes secret with the Amazon role
46+
* AWS_ROLE_SECRET_KEY (optional) -The key in the Kubernetes secret with the standard Amazon role. Default is 'role'
47+
48+
### Outputs
49+
* `image-name` – name of the reported image
50+
* `image-sha` – SHA of the reported image
51+
* `image-link` – link to the image in codefresh
52+
* `exit-error` – message of the error that caused template failure
53+
54+
## Examples
55+
56+
### task Example
57+
```
58+
apiVersion: argoproj.io/v1alpha1
59+
kind: Workflow
60+
metadata:
61+
generateName: report-image-info-
62+
spec:
63+
entrypoint: main
64+
templates:
65+
- name: main
66+
dag:
67+
tasks:
68+
- name: report-image-info
69+
templateRef:
70+
name: argo-hub.codefresh-csdp.1.1.13
71+
template: report-image-info
72+
arguments:
73+
parameters:
74+
- name: CF_API_KEY
75+
value: 'codefresh-token'
76+
- name: CF_API_KEY_SECRET_KEY
77+
value: 'token'
78+
- name: IMAGE_NAME
79+
value: 'deniscodefresh/ppid-inspector:latest'
80+
- name: DOCKERHUB_USERNAME
81+
value: 'dockerhub-creds'
82+
- name: USERNAME_SECRET_KEY
83+
value: 'username'
84+
- name: DOCKERHUB_PASSWORD
85+
value: 'dockerhub-creds'
86+
- name: PASSWORD_SECRET_KEY
87+
value: 'password'
88+
```
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.14.0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
network-timeout 3000000
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM node:22.14.0-bookworm-slim
2+
3+
RUN adduser --gecos "" --disabled-password --home /home/cfu --shell /bin/bash cfu
4+
5+
WORKDIR /app/
6+
7+
COPY package.json .
8+
COPY yarn.lock .
9+
10+
RUN apt-get update && \
11+
apt-get install -y python3 make g++
12+
RUN yarn --prod --network-timeout 3000000 && \
13+
yarn cache clean
14+
15+
COPY --chown=cfu --chmod=775 . .
16+
17+
RUN mkdir /cf-outputs && chmod 775 /cf-outputs && chown cfu /cf-outputs
18+
19+
USER cfu
20+
21+
CMD [ "node", "/app/src/index.js" ]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# image-enricher-git-info
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "image-enricher-git-info",
3+
"version": "0.0.3",
4+
"private": true,
5+
"scripts": {
6+
"start": "node src/index.js"
7+
},
8+
"engines": {
9+
"node": "22.14.0"
10+
},
11+
"resolutions": {
12+
"re2": "1.21.4",
13+
"tough-cookie": "4.1.3",
14+
"semver": "7.5.2"
15+
},
16+
"dependencies": {
17+
"@codefresh-io/cf-report-image-toolbox": "1.0.22",
18+
"joi": "^17.6.0",
19+
"lodash": "^4.17.21"
20+
}
21+
}

0 commit comments

Comments
 (0)