Skip to content

Commit 78d3e80

Browse files
authored
Add certify job to CI workflow (#187)
1 parent 15c9f79 commit 78d3e80

File tree

5 files changed

+46
-107
lines changed

5 files changed

+46
-107
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
build:
2525
name: Build Image
2626
runs-on: ubuntu-22.04
27+
outputs:
28+
version: ${{ steps.vars.outputs.version }}
2729
permissions:
2830
contents: write # for lucacome/draft-release to create a draft release
2931
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
@@ -148,16 +150,57 @@ jobs:
148150
- OpenShift {{openshift_version}} or newer.
149151
if: github.event_name != 'pull_request'
150152

153+
certify:
154+
name: Certify for Red Hat OpenShift
155+
runs-on: ubuntu-22.04
156+
needs: build
157+
if: ${{ github.ref_type == 'tag' }}
158+
steps:
151159
- name: Certify Images
152160
continue-on-error: true
153161
run: |
154-
curl -fsSL https://github.com/redhat-openshift-ecosystem/openshift-preflight/releases/download/1.6.9/preflight-linux-amd64 --output preflight
162+
curl -fsSL https://github.com/redhat-openshift-ecosystem/openshift-preflight/releases/download/1.7.0/preflight-linux-amd64 --output preflight
155163
chmod +x preflight
156164
157165
IFS=',' read -ra arch_list <<< "${{ env.platforms }}"
158166
159167
for arch in "${arch_list[@]}"; do
160168
architecture=("${arch#*/}")
161-
./preflight check container quay.io/nginx/nginx-ingress-operator:${{ steps.meta.outputs.version }} --pyxis-api-token ${{ secrets.PYXIS_API_TOKEN }} --certification-project-id ${{ secrets.CERTIFICATION_PROJECT_ID }} --platform $architecture --submit
169+
./preflight check container quay.io/nginx/nginx-ingress-operator:${{ needs.build.outputs.version }} --pyxis-api-token ${{ secrets.PYXIS_API_TOKEN }} --certification-project-id ${{ secrets.CERTIFICATION_PROJECT_ID }} --platform $architecture --submit
162170
done
163-
if: ${{ github.ref_type == 'tag' }}
171+
172+
- name: Make
173+
run: |
174+
make bundle USE_IMAGE_DIGESTS=true
175+
176+
- name: Checkout certified-operators repo
177+
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
178+
with:
179+
token: ${{ secrets.NGINX_PAT }}
180+
repository: nginx-bot/certified-operators
181+
path: certified-operators
182+
183+
- name: Update certified-operators repo
184+
working-directory: certified-operators/operators/nginx-ingress-operator
185+
run: |
186+
mkdir v${{ needs.build.outputs.version }}
187+
cp -R ../../../bundle/manifests v${{ needs.build.outputs.version }}/
188+
cp -R ../../../bundle/metadata v${{ needs.build.outputs.version }}/
189+
190+
- name: Commit changes
191+
uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d # v5.0.0
192+
with:
193+
commit_message: operator nginx-ingress-operator (v${{ needs.build.outputs.version }})
194+
commit_author: nginx-bot <[email protected]>
195+
commit_user_name: nginx-bot
196+
commit_user_email: [email protected]
197+
create_branch: true
198+
branch: update-nginx-ingress-operator-to-v${{ needs.build.outputs.version }}
199+
repository: certified-operators
200+
201+
- name: Create PR
202+
working-directory: certified-operators
203+
run: |
204+
gh pr create --title "operator nginx-ingress-operator (v${{ needs.build.outputs.version }})" --body "Update nginx-ingress-operator to v${{ needs.build.outputs.version }}" --head nginx-bot:update-nginx-ingress-operator-to-v${{ needs.build.outputs.version }} --base main --repo redhat-openshift-ecosystem/certified-operators
205+
env:
206+
GITHUB_TOKEN: ${{ secrets.NGINX_PAT }}

.github/workflows/pr-certified.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,3 @@ catalog-build: opm ## Build a catalog image.
231231
.PHONY: catalog-push
232232
catalog-push: ## Push a catalog image.
233233
$(MAKE) docker-push IMG=$(CATALOG_IMG)
234-
235-
# Get medatada to prepare the bundle to be submitted at https://github.com/redhat-openshift-ecosystem/certified-operators/
236-
.PHONY: get-metadata-certification
237-
get-metadata-certification:
238-
@./hack/get_image_info.sh ${IMAGE_TAG_BASE} ${VERSION}

hack/boilerplate.go.txt

Lines changed: 0 additions & 15 deletions
This file was deleted.

hack/get_image_info.sh

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)