Skip to content

Commit

Permalink
fix: use Dockerfile & fix bundle image tag (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosthe19916 authored Aug 1, 2024
1 parent 5f42b34 commit 8035fd2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
File renamed without changes.
35 changes: 22 additions & 13 deletions .github/workflows/image-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,23 @@ concurrency:
cancel-in-progress: true

jobs:
prepare:
runs-on: ubuntu-latest
steps:
- name: Extract tag
id: extract_tag
run: |
tag=$(if [[ ${{github.ref_name}} == v* ]];then echo "${{github.ref_name}}"; else echo "latest"; fi)
echo "tag=$tag" >> $GITHUB_OUTPUT
outputs:
tag: ${{ steps.extract_tag.outputs.tag }}

operator-build:
uses: trustification/release-tools/.github/workflows/build-push-images.yaml@main
with:
registry: "ghcr.io"
image_name: "${{ github.repository_owner }}/trustify-operator"
containerfile: "./Containerfile"
containerfile: "./Dockerfile"
architectures: '[ "amd64" ]'
secrets:
registry_username: ${{ github.actor }}
Expand All @@ -28,20 +39,22 @@ jobs:
bundle-build:
uses: trustification/release-tools/.github/workflows/build-push-images.yaml@main
needs:
- prepare
- operator-build
with:
registry: "ghcr.io"
image_name: "${{ github.repository_owner }}/trustify-operator-bundle"
containerfile: "./bundle.Containerfile"
containerfile: "./bundle.Dockerfile"
architectures: '[ "amd64" ]'
extra-args: "--build-arg IMAGE_GROUP=${{ github.repository_owner }}"
extra-args: "--build-arg IMAGE_GROUP=${{ github.repository_owner }} --build-arg IMAGE_TAG=${{ needs.prepare.outputs.tag }}"
secrets:
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.GITHUB_TOKEN }}

catalog-build:
runs-on: ubuntu-latest
needs:
- prepare
- bundle-build
steps:
- name: Setup OLM CLIs
Expand All @@ -54,24 +67,20 @@ jobs:
curl -LO ${OPERATOR_SDK_DL_URL}/${OS}-${ARCH}-opm
chmod +x ${OS}-${ARCH}-opm && sudo mv ${OS}-${ARCH}-opm /usr/local/bin/opm
- name: Extract tag
id: extract_tag
run: |
tag=$(if [[ ${{github.ref_name}} == v* ]];then echo "${{github.ref_name}}"; else echo "latest"; fi)
echo "TAG=$tag" >> $GITHUB_ENV
- name: Create catalog
run: |
opm index add \
--bundles ghcr.io/${{ github.repository_owner }}/trustify-operator-bundle:${{ env.TAG }} \
--tag ${{ github.repository_owner }}/trustify-operator-catalog:${{ env.TAG }} \
--bundles ghcr.io/${{ github.repository_owner }}/trustify-operator-bundle:$TAG \
--tag ${{ github.repository_owner }}/trustify-operator-catalog:$TAG \
--build-tool podman
env:
TAG: ${{ needs.prepare.outputs.tag }}

- name: Push To Registry
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ github.repository_owner }}/trustify-operator-catalog
tags: ${{ env.TAG }}
tags: ${{ needs.prepare.outputs.tag }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: "ghcr.io"
registry: "ghcr.io"
File renamed without changes.
3 changes: 2 additions & 1 deletion bundle.Containerfile → bundle.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
FROM quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-21 AS build
ARG IMAGE_GROUP
ARG IMAGE_TAG
COPY --chown=quarkus:quarkus mvnw /code/mvnw
COPY --chown=quarkus:quarkus .mvn /code/.mvn
COPY --chown=quarkus:quarkus pom.xml /code/
USER quarkus
WORKDIR /code
RUN ./mvnw -B org.apache.maven.plugins:maven-dependency-plugin:3.1.2:go-offline
COPY src/main /code/src/main
RUN ./mvnw package -DskipTests -Dquarkus.container-image.group=$IMAGE_GROUP
RUN ./mvnw package -DskipTests -Dquarkus.container-image.group=$IMAGE_GROUP -Dquarkus.container-image.tag=$IMAGE_TAG

FROM registry.access.redhat.com/ubi9/ubi:latest as bundle
COPY scripts /scripts
Expand Down

0 comments on commit 8035fd2

Please sign in to comment.