Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle image nightly build with limitador lastcommit #156

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .github/workflows/build-images-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
default: 0.0.0
type: string
operatorTag:
description: Operator tag
description: Operator bundle tag
default: latest
type: string
limitadorVersion:
Expand All @@ -23,14 +23,18 @@ on:
description: Bundle and catalog channels, comma separated
default: preview
type: string
imageTags:
description: Docker image tags
default: latest
type: string
workflow_dispatch:
inputs:
operatorVersion:
description: Operator bundle version
default: 0.0.0
type: string
operatorTag:
description: Operator tag
description: Operator bundle tag
default: latest
type: string
limitadorVersion:
Expand All @@ -47,7 +51,7 @@ on:
type: string

env:
IMG_TAGS: ${{ inputs.operatorTag }}
IMG_TAGS: ${{ inputs.imageTags || inputs.operatorTag }}
VERSION: ${{ inputs.operatorVersion }}
IMG_REGISTRY_HOST: quay.io
IMG_REGISTRY_ORG: kuadrant
Expand All @@ -60,7 +64,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install qemu dependency
run: |
sudo apt-get update
Expand Down Expand Up @@ -106,7 +110,7 @@ jobs:
go-version: 1.21.x
id: go
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install qemu dependency
run: |
sudo apt-get update
Expand All @@ -118,7 +122,6 @@ jobs:
REGISTRY=${{ env.IMG_REGISTRY_HOST }} \
ORG=${{ env.IMG_REGISTRY_ORG }} \
VERSION=${{ env.VERSION }} \
IMAGE_TAG=${{ inputs.operatorTag }} \
LIMITADOR_VERSION=${{ inputs.limitadorVersion }} \
REPLACES_VERSION=${{ inputs.replacesVersion }} \
CHANNELS=${{ inputs.channels }}
Expand Down Expand Up @@ -160,7 +163,7 @@ jobs:
go-version: 1.21.x
id: go
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Generate Catalog Content
run: |
make catalog \
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/build-images-branches.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: Build images for dev branches
name: Build images for branches

on:
push:
branches: ['*']
workflow_dispatch: {}

jobs:
workflow-build:
if: github.ref_name != 'main' && !startsWith(github.ref, 'refs/tags/v')
name: Calls build-images-base workflow
uses: ./.github/workflows/build-images-base.yaml
secrets: inherit
with:
operatorVersion: ${{ github.ref_name }}
operatorVersion: 0.0.0
operatorTag: ${{ github.ref_name }}
limitadorVersion: latest
imageTags: ${{ github.ref_name }}
11 changes: 0 additions & 11 deletions .github/workflows/build-images-main.yaml

This file was deleted.

43 changes: 40 additions & 3 deletions .github/workflows/build-images-scheduled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,50 @@ name: Schedule build with latest image SHA versions
on:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch: {}

jobs:
release-date:
name: GetDate
runs-on: ubuntu-latest
outputs:
release_date: ${{ steps.release_date.outputs.release_date }}
steps:
- id: release_date
run: echo "release_date=nightly-$(date +'%d-%m-%Y')" >> $GITHUB_OUTPUT
limitador-latest-revision:
name: Get the latest git commit from limitador in the default branch
runs-on: ubuntu-latest
outputs:
limitador_last_hash: ${{ steps.lastcommit.outputs.hash }}
steps:
- id: lastcommit
uses: nmbgeek/[email protected]
with:
repository: Kuadrant/limitador
# avoid the action failing due to API rate limiting
token: ${{ secrets.GITHUB_TOKEN }}
- name: Print Limitador's last commit revision
run: echo "${{ steps.lastcommit.outputs.hash }}"
check-limitador-image:
needs: limitador-latest-revision
name: Check limitador image exists
runs-on: ubuntu-latest
steps:
- name: Check image
uses: cloudposse/[email protected]
with:
registry: quay.io
organization: kuadrant
repository: limitador
tag: ${{ needs.limitador-latest-revision.outputs.limitador_last_hash }}
workflow-build:
needs: [release-date, check-limitador-image, limitador-latest-revision]
name: Calls build-images-base workflow
uses: ./.github/workflows/build-images-base.yaml
secrets: inherit
with:
operatorVersion: ${{ github.sha }}
operatorTag: ${{ github.sha }}
limitadorVersion: ${{ vars.LIMITADOR_SHA }}
operatorVersion: 0.0.0
imageTags: ${{ needs.release-date.outputs.release_date }} nightly-latest
operatorTag: ${{ needs.release-date.outputs.release_date }}
limitadorVersion: ${{ needs.limitador-latest-revision.outputs.limitador_last_hash }}
Loading