Skip to content

Commit

Permalink
Fix upstream build and push CI job
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Necas <[email protected]>
  • Loading branch information
mnecas committed Jan 21, 2025
1 parent 9d052da commit 500e0d6
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 36 deletions.
117 changes: 96 additions & 21 deletions .github/workflows/build-push-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,111 @@ on:
- release-*
workflow_dispatch:

env:
REGISTRY: quay.io
# Set tag 'latest' on main branch
REGISTRY_TAG: ${{ (github.head_ref||github.ref_name)=='main' && 'latest' || (github.head_ref||github.ref_name) }}
REGISTRY_ORG: mnecas0
VERSION: ${{ (github.head_ref||github.ref_name)=='main' && '99.0.0' || (github.head_ref||github.ref_name) }}

jobs:
build_push:
strategy:
fail-fast: false
matrix:
include:
- name: forklift-api
file: build/forklift-api/Containerfile
repo: forklift-api
- name: forklift-controller
file: build/forklift-controller/Containerfile
repo: forklift-controller
- name: forklift-operator
file: build/forklift-operator/Containerfile
repo: forklift-operator
- name: openstack-populator
file: build/openstack-populator/Containerfile
repo: openstack-populator
- name: openstack-populator
file: build/openstack-populator/Containerfile
repo: openstack-populator
- name: forklift-ova-provider-server
file: build/ova-provider-server/Containerfile
repo: forklift-ova-provider-server
- name: ovirt-populator
file: build/ovirt-populator/Containerfile-upstream
repo: ovirt-populator
- name: populator-controller
file: build/populator-controller/Containerfile
repo: populator-controller
- name: forklift-validation
file: build/validation/Containerfile
repo: forklift-validation
- name: virt-v2v
file: build/virt-v2v/Containerfile-upstream
repo: forklift-virt-v2v
runs-on: ubuntu-latest
steps:
- name: Checkout forklift
uses: actions/checkout@v4

- name: Login to ${{ env.REGISTRY }} with bot account
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}

- name: Build and push ${{ matrix.name }} image to ${{ env.REGISTRY }}
uses: docker/build-push-action@v6
with:
push: true
file: "${{ matrix.file }}"
tags: ${{ env.REGISTRY }}/${{ env.REGISTRY_ORG }}/${{ matrix.repo }}:${{ env.REGISTRY_TAG }}

build_push_bundle:
runs-on: ubuntu-latest
env:
REGISTRY: quay.io
# Set tag 'latest' on main branch
REGISTRY_TAG: ${{ (github.head_ref||github.ref_name)=='main' && 'latest' || (github.head_ref||github.ref_name) }}
REGISTRY_ORG: kubev2v
needs: build_push
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
swap-storage: false
docker-images: false
- name: Checkout forklift
uses: actions/checkout@v4

- name: Login to quay.io with bot account
- name: Login to ${{ env.REGISTRY }} with bot account
uses: docker/login-action@v3
with:
registry: quay.io
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}

- name: Build and push images to quay.io
run: |
cd ${GITHUB_WORKSPACE}
make push-all-images
- name: Build and push forklift-operator-bundle image to ${{ env.REGISTRY }}
uses: docker/build-push-action@v6
with:
push: true
file: "build/forklift-operator-bundle/Containerfile"
tags: ${{ env.REGISTRY }}/${{ env.REGISTRY_ORG }}/forklift-operator-bundle:${{ env.REGISTRY_TAG }}
build-args: |
VERSION=${{ env.VERSION }}
build_push_index:
runs-on: ubuntu-latest
needs: build_push_bundle
steps:
- name: Checkout forklift
uses: actions/checkout@v4

- name: Login to ${{ env.REGISTRY }} with bot account
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}

- name: Build and push forklift-operator-index image to ${{ env.REGISTRY }}
uses: docker/build-push-action@v6
with:
push: true
file: "build/forklift-operator-index/Containerfile"
tags: ${{ env.REGISTRY }}/${{ env.REGISTRY_ORG }}/forklift-operator-index:${{ env.REGISTRY_TAG }}
build-args: |
OPERATOR_BUNDLE_IMAGE=${{ env.REGISTRY }}/${{ env.REGISTRY_ORG }}/forklift-operator-bundle:${{ env.REGISTRY_TAG }}
STREAM=dev
2 changes: 0 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]

Expand Down
24 changes: 11 additions & 13 deletions build/forklift-operator-bundle/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@ FROM quay.io/konflux-ci/operator-sdk-builder@sha256:9f75516848faf6549f74213258f9

ARG STREAM=downstream
ARG VERSION="2.7.0"
ARG CONTROLLER_IMAGE \
API_IMAGE \
VIRT_V2V_IMAGE \
OPERATOR_IMAGE \
OPERATOR_BUNDLE_IMAGE \
OPERATOR_INDEX_IMAGE \
POPULATOR_CONTROLLER_IMAGE \
OVIRT_POPULATOR_IMAGE \
OPENSTACK_POPULATOR_IMAGE \
MUST_GATHER_IMAGE \
UI_PLUGIN_IMAGE \
OVA_PROVIDER_SERVER_IMAGE \
VALIDATION_IMAGE
ARG CONTROLLER_IMAGE="quay.io/kubev2v/forklift-controller:latest"
ARG API_IMAGE="quay.io/kubev2v/forklift-api:latest"
ARG VIRT_V2V_IMAGE="quay.io/kubev2v/forklift-virt-v2v:latest"
ARG OPERATOR_IMAGE="quay.io/kubev2v/forklift-operator:latest"
ARG POPULATOR_CONTROLLER_IMAGE="quay.io/kubev2v/populator-controller:latest"
ARG OVIRT_POPULATOR_IMAGE="quay.io/kubev2v/ovirt-populator:latest"
ARG OPENSTACK_POPULATOR_IMAGE="quay.io/kubev2v/openstack-populator:latest"
ARG MUST_GATHER_IMAGE="quay.io/kubev2v/forklift-must-gather:latest"
ARG UI_PLUGIN_IMAGE="quay.io/kubev2v/forklift-console-plugin:latest"
ARG OVA_PROVIDER_SERVER_IMAGE="quay.io/kubev2v/forklift-ova-provider-server:latest"
ARG VALIDATION_IMAGE="quay.io/kubev2v/forklift-validation:latest"

COPY ./operator /repo
WORKDIR /repo
Expand Down

0 comments on commit 500e0d6

Please sign in to comment.