[CI] Fix and unify image tags to lowercase, fix cut on localhost #3421
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [ 'main' ] | |
pull_request: | |
branches: [ 'main' ] | |
types: [ opened, reopened, synchronize ] | |
jobs: | |
build-api: | |
runs-on: ubuntu-latest | |
services: | |
registry: | |
image: registry:2 | |
ports: | |
- 5000:5000 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set Image Tag Env | |
run: echo "PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Cache Maven Packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
driver-opts: network=host | |
- name: Build and Test | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
SONAR_ORG: ${{secrets.SONAR_ORG}} | |
SONAR_PROJECT: ${{secrets.SONAR_PROJECT}} | |
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}} | |
run: | | |
# | |
# Set write-transformed-bytecode-to-build-output for IT coverage. Do NOT use the container image | |
# created by this step. | |
# | |
# See: https://quarkus.io/guides/tests-with-coverage#coverage-for-integration-tests | |
# | |
export QUARKUS_CONTAINER_IMAGE_REGISTRY="localhost:5000" | |
export QUARKUS_CONTAINER_IMAGE_PUSH=true | |
export QUARKUS_CONTAINER_IMAGE_TAG="${{ env.PROJECT_VERSION }}" | |
mvn verify -P container-image -B --no-transfer-progress \ | |
-Dquarkus.package.write-transformed-bytecode-to-build-output=true \ | |
-Dquarkus.docker.buildx.platform=linux/amd64,linux/arm64 | |
- name: Modify CSV Annotation | |
run: ./operator/bin/modify-bundle-metadata.sh | |
- name: Build Operator Bundle Image | |
uses: docker/build-push-action@v6 | |
with: | |
context: operator/target/bundle/console-operator/ | |
platforms: linux/amd64,linux/arm64 | |
provenance: false | |
push: false | |
file: operator/target/bundle/console-operator/bundle.Dockerfile | |
tags: | | |
streamshub/console-operator-bundle:${{ env.PROJECT_VERSION }} | |
- name: Build Operator Catalog | |
run: | | |
curl -L -o opm https://github.com/operator-framework/operator-registry/releases/download/v1.43.1/linux-amd64-opm | |
chmod +x opm | |
sudo cp -v opm /usr/bin/ | |
rm -vf opm | |
operator/bin/generate-catalog.sh ${{ env.PROJECT_VERSION }} | |
- name: Build Operator Catalog Image | |
uses: docker/build-push-action@v6 | |
with: | |
context: operator/target/ | |
platforms: linux/amd64,linux/arm64 | |
provenance: false | |
push: false | |
file: operator/target/catalog.Dockerfile | |
tags: | | |
streamshub/console-operator-catalog:${{ env.PROJECT_VERSION }} | |
- name: Archive Results | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: artifacts | |
path: api/target/failsafe-reports/ | |
## Save the context information for use in Sonar analysis | |
- name: Save Build Context | |
run: | | |
mkdir -vp target | |
echo "$GITHUB_CONTEXT" > target/build-context.json | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
## Attach the target directory for use in Sonar analysis | |
- name: Attach Build Output | |
uses: actions/upload-artifact@v4 | |
with: | |
name: target | |
path: | | |
**/target/ | |
!**/target/**/*.jar | |
!**/target/failsafe-reports/**/* | |
!**/target/surefire-reports/**/* | |
build-ui: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set Image Tag Env | |
run: echo "PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build UI | |
working-directory: ui | |
run: | | |
npm ci --omit=dev | |
export BACKEND_URL=http://example | |
export CONSOLE_METRICS_PROMETHEUS_URL=http://example | |
export NEXTAUTH_SECRET=examplesecret | |
export LOG_LEVEL=info | |
export CONSOLE_MODE=read-only | |
npm run build | |
- name: Build UI Image | |
uses: docker/build-push-action@v6 | |
with: | |
context: ui/ | |
platforms: linux/amd64,linux/arm64 | |
provenance: false | |
push: false | |
tags: | | |
streamshub/console-ui:${{ env.PROJECT_VERSION }} |