Skip to content

Commit

Permalink
fix call
Browse files Browse the repository at this point in the history
  • Loading branch information
leiicamundi committed Feb 27, 2024
1 parent 03f4371 commit c1e7543
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 4 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/01-build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,20 @@ on:
push:

jobs:
trigger-next-workflows:
runs-on: ubuntu-22.04
needs:
- docker-build
steps:
- name: Test built images
uses: ./.github/workflows/30-test-images.yml@main
with:
test_image_name: ${{ needs.docker-build.outputs.built_image_metadata | jq -r '.image.name + ":" + .containerimage.digest' }}

docker-build:
runs-on: ubuntu-latest
outputs:
built_image_metadata: ${{ steps.build-image-step.outputs.metadata }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -21,6 +33,7 @@ jobs:
yarn-enabled: false

- name: Build image using Camunda docker build
id: build-image-step
uses: camunda/infra-global-github-actions/build-docker-image@feature/container-build-multiarch
with:
registry_host: ${{ vars.CONTAINER_REGISTRY }}
Expand All @@ -30,6 +43,3 @@ jobs:
image_name: ${{ vars.CONTAINER_IMAGE_NAME }}
build_context: .
build_platforms: linux/amd64,linux/arm64

- name: Test built images
uses: ./.github/workflows/30-test-images.yml
31 changes: 30 additions & 1 deletion .github/workflows/30-test-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,23 @@ name: test-images

on:
workflow_call:
inputs:
test_image_name:
description: "Fully qualified image name with registry and tag (e.g. `docker.io/myuser/myimage:feature@sha256:378738...`)"
required: true
type: string


jobs:
trigger-next-workflows:
runs-on: ubuntu-22.04
needs:
- test-base-image
- test-postgres-integ
steps:
- name: Publish images
uses: ./.github/workflows/90-publish-images.yml

test-base-image:
runs-on: ubuntu-latest
steps:
Expand All @@ -20,10 +34,17 @@ jobs:
java-enabled: false
yarn-enabled: false

- name: Login to the registry
uses: docker/login-action@v3
with:
registry: ${{ vars.CONTAINER_REGISTRY }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# TODO: use current version of the image in the shell
- name: KeyCloak Show-Config
run: |
docker run camunda/keycloak-aws:latest show-config >> docker.log
docker run ${{ inputs.test_image_name }} show-config >> docker.log
echo "config=$(cat docker.log | tr '\n' ' ')" >> "$GITHUB_ENV"
- name: Assert Config
Expand All @@ -44,6 +65,13 @@ jobs:
java-enabled: false
yarn-enabled: false

- name: Login to the registry
uses: docker/login-action@v3
with:
registry: ${{ vars.CONTAINER_REGISTRY }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Start Test Environment
uses: ./.github/actions/compose
with:
Expand All @@ -56,4 +84,5 @@ jobs:
- name: Test Environment
run: python3 ./.github/scripts/integration/main.py


# TODO: add tests (static framework tbd) then push

0 comments on commit c1e7543

Please sign in to comment.