Skip to content

Commit

Permalink
Merge pull request #132 from adam-cattermole/include-commit-sha
Browse files Browse the repository at this point in the history
Set commit sha in bundle/catalog
  • Loading branch information
adam-cattermole authored Sep 14, 2023
2 parents f4bc35c + 8e26662 commit 75b9f81
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ jobs:
sudo apt-get install -y qemu-user-static
- name: Run make bundle (main)
if: ${{ github.ref_name == env.MAIN_BRANCH_NAME }}
run: make bundle REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }}
run: make bundle REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} IMAGE_TAG=${{ github.sha }}
- name: Run make bundle (release)
if: ${{ github.ref_name != env.MAIN_BRANCH_NAME }}
run: make bundle REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} VERSION=${TAG_NAME/v/} AUTHORINO_VERSION=${{ github.event.inputs.authorinoVersion }}
- name: Git diff
run: git diff
- name: Verify manifests and bundle (main)
if: github.ref_name == env.MAIN_BRANCH_NAME
run: make verify-manifests verify-bundle REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }}
run: make verify-manifests verify-bundle REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} IMAGE_TAG=${{ github.sha }}
- name: Verify manifests and bundle (release)
if: ${{ github.ref_name != env.MAIN_BRANCH_NAME }}
run: make verify-manifests verify-bundle REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} VERSION=${TAG_NAME/v/} AUTHORINO_VERSION=${{ github.event.inputs.authorinoVersion }}
Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:
sudo apt-get install -y qemu-user-static
- name: Run make catalog-generate (main)
if: ${{ github.ref_name == env.MAIN_BRANCH_NAME }}
run: make catalog-generate REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }}
run: make catalog-generate REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} IMAGE_TAG=${{ github.sha }}
- name: Run make catalog-generate (release)
if: ${{ github.ref_name != env.MAIN_BRANCH_NAME }}
run: make catalog-generate REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} IMAGE_TAG=${{ env.TAG_NAME }}
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ jobs:
run: |
make verify-manifests
verify-bundle:
name: Verify bundle
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.19.x
uses: actions/setup-go@v4
with:
go-version: 1.19.x
id: go
- name: Check out code
uses: actions/checkout@v3
- name: Run make verify-bundle
run: |
make verify-bundle
verify-fmt:
name: Verify fmt
runs-on: ubuntu-latest
Expand Down
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -295,14 +295,18 @@ catalog-push: ## Push a catalog image.
## Targets to verify actions that generate/modify code have been executed and output committed

.PHONY: verify-manifests
verify-manifests: manifests ## Verify manifests update.
git diff --exit-code ./config
verify-manifests: manifests $(YQ) ## Verify manifests update.
git diff -I'^ containerImage:' -I'^ image:' --exit-code ./config
[ -z "$$(git ls-files --other --exclude-standard --directory --no-empty-directory ./config)" ]
yq ea -e 'select([.][].kind == "Deployment").spec.template.spec.containers[0].image | . == "$(OPERATOR_IMAGE)"' config/deploy/manifests.yaml
yq e -e '.metadata.annotations.containerImage == "$(OPERATOR_IMAGE)"' config/manifests/bases/authorino-operator.clusterserviceversion.yaml

.PHONY: verify-bundle
verify-bundle: bundle ## Verify bundle update.
git diff --exit-code ./bundle
verify-bundle: bundle $(YQ) ## Verify bundle update.
git diff -I'^ containerImage:' -I'^ image:' --exit-code ./bundle
[ -z "$$(git ls-files --other --exclude-standard --directory --no-empty-directory ./bundle)" ]
yq e -e '.metadata.annotations.containerImage == "$(OPERATOR_IMAGE)"' bundle/manifests/authorino-operator.clusterserviceversion.yaml
yq e -e '.spec.install.spec.deployments[0].spec.template.spec.containers[0].image == "$(OPERATOR_IMAGE)"' bundle/manifests/authorino-operator.clusterserviceversion.yaml

.PHONY: verify-fmt
verify-fmt: fmt ## Verify fmt update.
Expand Down

0 comments on commit 75b9f81

Please sign in to comment.