Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
feat: build standalone images
Browse files Browse the repository at this point in the history
  • Loading branch information
lburgazzoli authored and lordrip committed Jul 26, 2023
1 parent 50a2f7e commit 61de913
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/generate-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,21 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

standalone:
uses: ./.github/workflows/standalone-build-and-push.yml
needs:
- build
- build-for-mac
- docker-for-mac
if: ${{ github.event_name != 'pull_request' }}
with:
tag: "${{ github.ref_name }}-${{ github.sha }}"
alias: "latest"
frontend-version: main
backend-version: main
secrets:
docker-username: ${{ secrets.DOCKER_USERNAME }}
docker-password: ${{ secrets.DOCKER_PASSWORD }}
quay-username: ${{ secrets.QUAY_USERNAME }}
quay-password: ${{ secrets.QUAY_PASSWORD }}
28 changes: 28 additions & 0 deletions .github/workflows/publish-standalone-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish Standalone Release

on:
workflow_dispatch:
inputs:
backend-version:
required: true
type: string
frontend-version:
required: true
type: string
standalone-version:
required: true
type: string

jobs:
build:
uses: ./.github/workflows/standalone-build-and-push.yml
with:
tag: ${{ inputs.standalone-version }}
alias: "stable"
frontend-version: ${{ inputs.frontend-version }}
backend-version: ${{ inputs.backend-version }}
secrets:
docker-username: ${{ secrets.DOCKER_USERNAME }}
docker-password: ${{ secrets.DOCKER_PASSWORD }}
quay-username: ${{ secrets.QUAY_USERNAME }}
quay-password: ${{ secrets.QUAY_PASSWORD }}
105 changes: 105 additions & 0 deletions .github/workflows/standalone-build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Standalone Build And Push

on:
workflow_call:
inputs:
tag:
required: true
type: string
alias:
required: true
type: string
backend-version:
required: true
type: string
frontend-version:
required: true
type: string
secrets:
docker-username:
required: true
docker-password:
required: true
quay-username:
required: true
quay-password:
required: true

env:
KAOTO_TAG: ${{ inputs.tag }}
UI_TAG: ${{ inputs.frontend-version }}
API_TAG: ${{ inputs.backend-version }}
MAVEN_ARGS: -V -ntp -Dhttp.keepAlive=false -DskipTests=true -e

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
variant:
- native
- jvm
steps:
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
check-latest: true
- name: 'Checkout'
uses: actions/checkout@v3
with:
repository: KaotoIO/kaoto-backend
ref: ${{ inputs.backend-version }}
- name: 'Build Container Image (${{ matrix.variant }})'
run: |
./mvnw ${MAVEN_ARGS} clean install \
-Dpmd.skip=true \
-DskipTests \
-P${{ matrix.variant }} \
-Pcontainer-image \
-Pstandalone \
-Dkaoto.ui.branch=${{ inputs.frontend-version }} \
-Dquarkus.container-image.tag=${{ inputs.tag }}-${{ matrix.variant }} \
-Dquarkus.container-image.additional-tags=${{ inputs.alias }}-${{ matrix.variant }}
- name: Run built image
run: |
docker images
docker run -d --rm -p 8081:8081 --name kaoto-standalone kaotoio/standalone:${{ inputs.tag }}-${{ matrix.variant }}
- name: List running images
run: |
docker ps -a
- name: Check the deployed service URL
run: |
curl --fail -sv --retry 15 --retry-delay 1 --retry-all-errors http://localhost:8081/q/health
#
# DockerHub
#

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.docker-username }}
password: ${{ secrets.docker-password }}
- name: 'Push Images to DockerHub'
run: |
docker push docker.io/kaotoio/standalone --all-tags
#
# Quay
#
- name: Login to Quay.io
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.quay-username }}
password: ${{ secrets.quay-password }}
- name: Tag Quay images
run: |
docker tag kaotoio/standalone:${{ inputs.tag }}-${{ matrix.variant }} quay.io/kaotoio/standalone:${{ inputs.tag }}-${{ matrix.variant }}
docker tag kaotoio/standalone:${{ inputs.tag }}-${{ matrix.variant }} quay.io/kaotoio/standalone:${{ inputs.alias }}-${{ matrix.variant }}
- name: 'Push Images to Quay.io'
run: |
docker push quay.io/kaotoio/standalone --all-tags

0 comments on commit 61de913

Please sign in to comment.