Skip to content

Commit

Permalink
bundle image nightly build with limitador lastcommit
Browse files Browse the repository at this point in the history
Signed-off-by: Eguzki Astiz Lezaun <eastizle@redhat.com>
  • Loading branch information
eguzki committed Sep 4, 2024
1 parent 8d7e9ed commit cf1d16b
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 24 deletions.
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/github-action-get-latest-commit@v0.1.0
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/github-action-docker-image-exists@0.2.0
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 }}

0 comments on commit cf1d16b

Please sign in to comment.