Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task: align operator change to decompose ui #7

Merged
merged 2 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,3 @@ jobs:
uses: ./.github/workflows/global-ci.yml
with:
operator_bundle: "ghcr.io/trustification/trustify-operator-bundle:latest"
# TODO
# We run this against ghcr.io/trustification/trustd:latest which does not contain the
# latest version of the UI. Therefore the UI tests will always fail.
# The repository https://github.com/trustification/trustify needs to find a way to continuously
# update the UI before this property is enabled
run_ui_tests: false
33 changes: 30 additions & 3 deletions .github/workflows/global-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ on:
type: string
required: false
default: ""
ui_image:
description: image uri for the ui (ie. ghcr.io/<namespace>/<image-name>:<tag>)
type: string
required: false
default: ""
server_image:
description: image uri for the server (ie. ghcr.io/<namespace>/<image-name>:<tag>)
type: string
Expand Down Expand Up @@ -75,6 +80,11 @@ on:
type: string
required: false
default: ""
ui_image:
description: image uri for the ui (ie. ghcr.io/<namespace>/<image-name>:<tag>)
type: string
required: false
default: ""
server_image:
description: image uri for the server (ie. ghcr.io/<namespace>/<image-name>:<tag>)
type: string
Expand Down Expand Up @@ -142,11 +152,12 @@ jobs:
- name: Check operator images exists
if: ${{ inputs.operator_bundle != '' }}
env:
UI: ${{ inputs.ui_image }}
SERVER: ${{ inputs.server_image }}
SERVER_DB: ${{ inputs.server_db_image }}
run: |
# My cheap way to check if any other image is set
if [ -n "${SERVER}${SERVER_DB}" ]; then
if [ -n "${UI}${SERVER}${SERVER_DB}" ]; then
echo "::warning:: operator_bundle takes precendent over any other image specified!"
echo "::warning:: consider removing the image and setting it on the Trustify CR."
fi
Expand All @@ -160,6 +171,16 @@ jobs:
echo "Image does not exist locally"
docker manifest inspect ${{ inputs.operator_bundle }}
fi
- name: Check ui image exists
if: ${{ inputs.ui_image != '' }}
run: |
if docker image inspect ${{ inputs.ui_image }} >/dev/null 2>&1; then
echo "Image exists locally"
docker image inspect ${{ inputs.ui_image }}
else
echo "Image does not exist locally"
docker manifest inspect ${{ inputs.ui_image }}
fi
- name: Check server image exists
if: ${{ inputs.server_image != '' }}
run: |
Expand Down Expand Up @@ -235,6 +256,7 @@ jobs:
uses: trustification/trustify-operator/.github/actions/make-bundle@main
with:
operator_bundle: ${{ env.operator_bundle }}
ui: ${{ inputs.ui_image }}
server: ${{ inputs.server_image }}
server_postgres: ${{ inputs.server_db_image }}
- name: Push bundle
Expand All @@ -243,15 +265,17 @@ jobs:

- name: prepare trustify-cr
run: |
[ -n "${{ inputs.ui_image }}" ] && UI_IMAGE=\"${{ inputs.ui_image }}\" || UI_IMAGE=null
[ -n "${{ inputs.server_image }}" ] && SERVER_IMAGE=\"${{ inputs.server_image }}\" || SERVER_IMAGE=null
[ -n "${{ inputs.server_db_image }}" ] && SERVER_DB_IMAGE=\"${{ inputs.server_db_image }}\" || SERVER_DB_IMAGE=null
echo "UI_IMAGE=${UI_IMAGE}" >>"$GITHUB_ENV"
echo "SERVER_IMAGE=${SERVER_IMAGE}" >>"$GITHUB_ENV"
echo "SERVER_DB_IMAGE=${SERVER_DB_IMAGE}" >>"$GITHUB_ENV"
- name: install trustify
uses: trustification/trustify-operator/.github/actions/install-trustify@main
with:
operator-bundle-image: ${{ inputs.operator_bundle || env.operator_bundle }}
trustify-cr: '{"kind":"Trustify","apiVersion":"org.trustify/v1alpha1","metadata":{"name":"myapp"},"spec":{"serverImage":${{ env.SERVER_IMAGE }},"dbImage":${{ env.SERVER_DB_IMAGE }},"imagePullPolicy":"IfNotPresent"}}'
trustify-cr: '{"kind":"Trustify","apiVersion":"org.trustify/v1alpha1","metadata":{"name":"myapp"},"spec":{"uiImage":${{ env.UI_IMAGE }},"serverImage":${{ env.SERVER_IMAGE }},"dbImage":${{ env.SERVER_DB_IMAGE }},"imagePullPolicy":"IfNotPresent"}}'
# end DRY

- name: Wait for Ingress and expose Trustify URL
Expand Down Expand Up @@ -334,6 +358,7 @@ jobs:
uses: trustification/trustify-operator/.github/actions/make-bundle@main
with:
operator_bundle: ${{ env.operator_bundle }}
ui: ${{ inputs.ui_image }}
server: ${{ inputs.server_image }}
server_postgres: ${{ inputs.server_db_image }}
- name: Push bundle
Expand All @@ -342,15 +367,17 @@ jobs:

- name: prepare trustify-cr
run: |
[ -n "${{ inputs.ui_image }}" ] && UI_IMAGE=\"${{ inputs.ui_image }}\" || UI_IMAGE=null
[ -n "${{ inputs.server_image }}" ] && SERVER_IMAGE=\"${{ inputs.server_image }}\" || SERVER_IMAGE=null
[ -n "${{ inputs.server_db_image }}" ] && SERVER_DB_IMAGE=\"${{ inputs.server_db_image }}\" || SERVER_DB_IMAGE=null
echo "UI_IMAGE=${UI_IMAGE}" >>"$GITHUB_ENV"
echo "SERVER_IMAGE=${SERVER_IMAGE}" >>"$GITHUB_ENV"
echo "SERVER_DB_IMAGE=${SERVER_DB_IMAGE}" >>"$GITHUB_ENV"
- name: install trustify
uses: trustification/trustify-operator/.github/actions/install-trustify@main
with:
operator-bundle-image: ${{ inputs.operator_bundle || env.operator_bundle }}
trustify-cr: '{"kind":"Trustify","apiVersion":"org.trustify/v1alpha1","metadata":{"name":"myapp"},"spec":{"serverImage":${{ env.SERVER_IMAGE }},"dbImage":${{ env.SERVER_DB_IMAGE }},"imagePullPolicy":"IfNotPresent"}}'
trustify-cr: '{"kind":"Trustify","apiVersion":"org.trustify/v1alpha1","metadata":{"name":"myapp"},"spec":{"uiImage":${{ env.SERVER_IMAGE }},"serverImage":${{ env.SERVER_IMAGE }},"dbImage":${{ env.SERVER_DB_IMAGE }},"imagePullPolicy":"IfNotPresent"}}'
# end DRY

- name: Wait for Ingress and expose Trustify service
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/nightly-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,4 @@ jobs:
api_tests_ref: main
run_api_tests: true
ui_tests_ref: main
# TODO
# We run this against ghcr.io/trustification/trustd:latest which does not contain the
# latest version of the UI. Therefore the UI tests will always fail.
# The repository https://github.com/trustification/trustify needs to find a way to continuously
# update the UI before this property is enabled
run_ui_tests: false
run_ui_tests: true