Skip to content

Commit dc5379e

Browse files
committed
expose REKOR and TUF in GH Actions and Jenkins
REKOR_HOST and TUF_MIRROR are not exposed and can't be set by users in secrets/credentials in GH Actions and Jenkins Expose them in GH Actions. When getting an environment variable from secrets, GitHub always creates an env var, it just sets it to an empty string when secret is not set. This is going to be handled in env.sh in template definitions Add them to Jenkins too, but leave them commented out and let users uncomment them when needed
1 parent 7b1b8bf commit dc5379e

File tree

5 files changed

+58
-2
lines changed

5 files changed

+58
-2
lines changed

generated/gitops-template/githubactions/.github/workflows/gitops-promotion.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ env:
2727
IMAGE_REGISTRY_USER: ${{ secrets.IMAGE_REGISTRY_USER }}
2828
# Set this password for your specific registry
2929
IMAGE_REGISTRY_PASSWORD: ${{ secrets.IMAGE_REGISTRY_PASSWORD }}
30+
# Set this only when using an external Rekor instance
31+
REKOR_HOST: ${{ secrets.REKOR_HOST }}
32+
# Set this only when using an external TUF instance
33+
TUF_MIRROR: ${{ secrets.TUF_MIRROR }}
3034
# QUAY_IO_CREDS_USR: ${{ secrets.QUAY_IO_CREDS_USR }}
3135
# QUAY_IO_CREDS_PSW: ${{ secrets.QUAY_IO_CREDS_PSW }}
3236
# ARTIFACTORY_IO_CREDS_USR: ${{ secrets.ARTIFACTORY_IO_CREDS_USR }}
@@ -73,6 +77,10 @@ jobs:
7377
IMAGE_REGISTRY_USER: `${{ secrets.IMAGE_REGISTRY_USER }}`,
7478
/* Set this password for your specific registry */
7579
IMAGE_REGISTRY_PASSWORD: `${{ secrets.IMAGE_REGISTRY_PASSWORD }}`,
80+
/* Set this only when using an external Rekor instance */
81+
REKOR_HOST: `${{ secrets.REKOR_HOST }}`,
82+
/* Set this only when using an external TUF instance */
83+
TUF_MIRROR: `${{ secrets.TUF_MIRROR }}`,
7684
/*QUAY_IO_CREDS_USR: `${{ secrets.QUAY_IO_CREDS_USR }}`, */
7785
/*QUAY_IO_CREDS_PSW: `${{ secrets.QUAY_IO_CREDS_PSW }}`, */
7886
/*ARTIFACTORY_IO_CREDS_USR: `${{ secrets.ARTIFACTORY_IO_CREDS_USR }}`, */

generated/gitops-template/jenkins/Jenkinsfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ pipeline {
2626
QUAY_IO_CREDS = credentials('QUAY_IO_CREDS')
2727
/* ARTIFACTORY_IO_CREDS = credentials('ARTIFACTORY_IO_CREDS') */
2828
/* NEXUS_IO_CREDS = credentials('NEXUS_IO_CREDS') */
29+
/* Set when using Jenkins on non-local cluster and using an external Rekor instance */
30+
/* REKOR_HOST = credentials('REKOR_HOST') */
31+
/* Set when using Jenkins on non-local cluster and using an external TUF instance */
32+
/* TUF_MIRROR = credentials('TUF_MIRROR') */
2933
}
3034
stages {
3135
stage('Verify EC') {

generated/source-repo/githubactions/.github/workflows/build-and-update-gitops.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ env:
2323
IMAGE_REGISTRY_USER: ${{ secrets.IMAGE_REGISTRY_USER }}
2424
# Set this password for your specific registry
2525
IMAGE_REGISTRY_PASSWORD: ${{ secrets.IMAGE_REGISTRY_PASSWORD }}
26+
# Set this only when using an external Rekor instance
27+
REKOR_HOST: ${{ secrets.REKOR_HOST }}
28+
# Set this only when using an external TUF instance
29+
TUF_MIRROR: ${{ secrets.TUF_MIRROR }}
2630
# QUAY_IO_CREDS_USR: ${{ secrets.QUAY_IO_CREDS_USR }}
2731
# QUAY_IO_CREDS_PSW: ${{ secrets.QUAY_IO_CREDS_PSW }}
2832
# ARTIFACTORY_IO_CREDS_USR: ${{ secrets.ARTIFACTORY_IO_CREDS_USR }}
@@ -74,6 +78,10 @@ jobs:
7478
IMAGE_REGISTRY_USER: `${{ secrets.IMAGE_REGISTRY_USER }}`,
7579
/* Set this password for your specific registry */
7680
IMAGE_REGISTRY_PASSWORD: `${{ secrets.IMAGE_REGISTRY_PASSWORD }}`,
81+
/* Set this only when using an external Rekor instance */
82+
REKOR_HOST: `${{ secrets.REKOR_HOST }}`,
83+
/* Set this only when using an external TUF instance */
84+
TUF_MIRROR: `${{ secrets.TUF_MIRROR }}`,
7785
/*QUAY_IO_CREDS_USR: `${{ secrets.QUAY_IO_CREDS_USR }}`, */
7886
/*QUAY_IO_CREDS_PSW: `${{ secrets.QUAY_IO_CREDS_PSW }}`, */
7987
/*ARTIFACTORY_IO_CREDS_USR: `${{ secrets.ARTIFACTORY_IO_CREDS_USR }}`, */

generated/source-repo/jenkins/Jenkinsfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ pipeline {
2323
COSIGN_SECRET_PASSWORD = credentials('COSIGN_SECRET_PASSWORD')
2424
COSIGN_SECRET_KEY = credentials('COSIGN_SECRET_KEY')
2525
COSIGN_PUBLIC_KEY = credentials('COSIGN_PUBLIC_KEY')
26+
/* Set when using Jenkins on non-local cluster and using an external Rekor instance */
27+
/* REKOR_HOST = credentials('REKOR_HOST') */
28+
/* Set when using Jenkins on non-local cluster and using an external TUF instance */
29+
/* TUF_MIRROR = credentials('TUF_MIRROR') */
2630
}
2731
stages {
2832
stage('init') {

templates/data.yaml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ build_secrets:
2727
- name: IMAGE_REGISTRY_PASSWORD
2828
if: 'isGitHub'
2929
comment: "Set this password for your specific registry"
30+
# Expose Rekor and TUF in GitHub Actions so they can be set by user in secrets
31+
- name: REKOR_HOST
32+
if: 'isGitHub'
33+
comment: "Set this only when using an external Rekor instance"
34+
- name: TUF_MIRROR
35+
if: 'isGitHub'
36+
comment: "Set this only when using an external TUF instance"
3037
- name: IMAGE_REGISTRY_USER
3138
if: '!isGitHub'
3239
commented_out: true
@@ -66,6 +73,15 @@ build_secrets:
6673
- name: COSIGN_SECRET_PASSWORD
6774
- name: COSIGN_SECRET_KEY
6875
- name: COSIGN_PUBLIC_KEY
76+
# Rekor and TUF again, but there is a difference between GH Actions and Jenkins
77+
- name: REKOR_HOST
78+
if: 'isJenkins'
79+
comment: "Set when using Jenkins on non-local cluster and using an external Rekor instance"
80+
commented_out: true
81+
- name: TUF_MIRROR
82+
if: 'isJenkins'
83+
comment: "Set when using Jenkins on non-local cluster and using an external TUF instance"
84+
commented_out: true
6985

7086
gitops_steps:
7187
- name: Verify EC
@@ -91,7 +107,14 @@ gitops_secrets:
91107
comment: "Set this to the user for your specific registry"
92108
- name: IMAGE_REGISTRY_PASSWORD
93109
if: 'isGitHub'
94-
comment: "Set this password for your specific registry"
110+
comment: "Set this password for your specific registry"
111+
# Expose Rekor and TUF in GitHub Actions so they can be set by user in secrets
112+
- name: REKOR_HOST
113+
if: 'isGitHub'
114+
comment: "Set this only when using an external Rekor instance"
115+
- name: TUF_MIRROR
116+
if: 'isGitHub'
117+
comment: "Set this only when using an external TUF instance"
95118
# other CIs in transition so comment out and leave Quay.io
96119
- name: IMAGE_REGISTRY_USER
97120
if: '!isGitHub'
@@ -129,4 +152,13 @@ gitops_secrets:
129152
commented_out: true
130153
- name: NEXUS_IO_CREDS_PSW
131154
if: '!isJenkins'
132-
commented_out: true
155+
commented_out: true
156+
# Rekor and TUF again, but there is a difference between GH Actions and Jenkins
157+
- name: REKOR_HOST
158+
if: 'isJenkins'
159+
comment: "Set when using Jenkins on non-local cluster and using an external Rekor instance"
160+
commented_out: true
161+
- name: TUF_MIRROR
162+
if: 'isJenkins'
163+
comment: "Set when using Jenkins on non-local cluster and using an external TUF instance"
164+
commented_out: true

0 commit comments

Comments
 (0)