Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Point users to reference implementation #1875

Point users to reference implementation

Point users to reference implementation #1875

name: PR checks - Build operator images
on:
pull_request:
branches:
- master
- 'release-v**.x'
env:
SDK_VERSION: "1.17.0"
CONTAINER_RUNTIME: "podman"
ARTIFACTS: "artifacts"
REGISTRY_PREFIX: quay.io/redhat-developer
REPO: servicebinding-operator
jobs:
build-operator-images:
name: "Build operator images (PR)"
runs-on: ubuntu-20.04
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "^1.18"
- name: Checkout Git Repository
uses: actions/checkout@v4
- name: Setup CLI
uses: ./.github/actions/setup-cli
with:
operator-sdk: true
- name: Setup local registry
run: |
.github/actions/setup-podman/setup-local-registry.sh
.github/actions/setup-podman/setup-podman-wrapper.sh
- name: Build images
env:
PR_NUMBER: ${{github.event.pull_request.number}}
PR_SHA: ${{github.event.pull_request.head.sha}}
OPERATOR_REPO_REF: ${{env.REGISTRY_PREFIX}}/${{env.REPO}}
run: |
export TAG=pr-${PR_NUMBER}-${PR_SHA:0:8}
export OPERATOR_IMAGE_REF=${OPERATOR_REPO_REF}:${TAG}
export OPERATOR_BUNDLE_IMAGE_REF=${OPERATOR_IMAGE_REF}-bundle
export OPERATOR_INDEX_IMAGE_REF=$(make operator-index-image-ref)
export OPERATOR_UPGRADE_INDEX_IMAGE_REF=${OPERATOR_IMAGE_REF}-index
export OPERATOR_BUNDLE_VERSION=$(make operator-version)-${TAG}
which podman
make opm
podman pull ${OPERATOR_INDEX_IMAGE_REF}
OPM=.github/actions/setup-podman/opm BUILDAH_FORMAT=docker make SKIP_REGISTRY_LOGIN=true push-index-image-upgrade -o registry-login
mkdir -p ${ARTIFACTS}
echo "export OPERATOR_IMAGE_REF=${OPERATOR_IMAGE_REF}" >> ${ARTIFACTS}/operator.refs
echo "export OPERATOR_BUNDLE_IMAGE_REF=${OPERATOR_BUNDLE_IMAGE_REF}" >> ${ARTIFACTS}/operator.refs
echo "export OPERATOR_INDEX_IMAGE_REF=${OPERATOR_UPGRADE_INDEX_IMAGE_REF}" >> ${ARTIFACTS}/operator.refs
podman stop reg
tar -czvf ${ARTIFACTS}/registry.tar.gz -C ${GITHUB_WORKSPACE} registry
- name: Archive images
uses: actions/upload-artifact@v3
with:
name: operator-images-${{github.event.pull_request.number}}-${{github.event.pull_request.head.sha}}
path: ${{env.ARTIFACTS}}/*.tar.gz
- name: Archive image references
uses: actions/upload-artifact@v3
with:
name: operator-refs-${{github.event.pull_request.number}}-${{github.event.pull_request.head.sha}}
path: ${{env.ARTIFACTS}}/*.refs