Skip to content

Commit

Permalink
Revert "task: align operator change to decompose ui" (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosthe19916 authored Nov 7, 2024
1 parent a70ad25 commit 650de55
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 31 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ 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: 3 additions & 30 deletions .github/workflows/global-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ 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 @@ -80,11 +75,6 @@ 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 @@ -152,12 +142,11 @@ 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 "${UI}${SERVER}${SERVER_DB}" ]; then
if [ -n "${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 @@ -171,16 +160,6 @@ 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 @@ -256,7 +235,6 @@ 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 @@ -265,17 +243,15 @@ 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":{"uiImage":${{ env.UI_IMAGE }},"serverImage":${{ env.SERVER_IMAGE }},"dbImage":${{ env.SERVER_DB_IMAGE }},"imagePullPolicy":"IfNotPresent"}}'
trustify-cr: '{"kind":"Trustify","apiVersion":"org.trustify/v1alpha1","metadata":{"name":"myapp"},"spec":{"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 @@ -358,7 +334,6 @@ 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 @@ -367,17 +342,15 @@ 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":{"uiImage":${{ env.SERVER_IMAGE }},"serverImage":${{ env.SERVER_IMAGE }},"dbImage":${{ env.SERVER_DB_IMAGE }},"imagePullPolicy":"IfNotPresent"}}'
trustify-cr: '{"kind":"Trustify","apiVersion":"org.trustify/v1alpha1","metadata":{"name":"myapp"},"spec":{"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: 6 additions & 1 deletion .github/workflows/nightly-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ jobs:
api_tests_ref: main
run_api_tests: true
ui_tests_ref: main
run_ui_tests: true
# 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

0 comments on commit 650de55

Please sign in to comment.