From df92a776b3742a67cd8ef2f47654db6186f54fd9 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:41:19 -0800 Subject: [PATCH 01/94] Update frontend.dc.yaml --- .../templates/ecas-frontend/frontend.dc.yaml | 39 ++++++++++++++++++- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/openshift/templates/ecas-frontend/frontend.dc.yaml b/openshift/templates/ecas-frontend/frontend.dc.yaml index 106beaf40..cea35d904 100644 --- a/openshift/templates/ecas-frontend/frontend.dc.yaml +++ b/openshift/templates/ecas-frontend/frontend.dc.yaml @@ -14,6 +14,9 @@ creationTimestamp: labels: app: "${APP_NAME}" + name: "${APP_NAME}-frontend" + app-group: "${APP_NAME}" + template: "educ-${APP_NAME}-template" name: "${APP_NAME}-frontend" spec: replicas: ${{MIN_REPLICAS}} @@ -114,12 +117,37 @@ test: false triggers: - type: ConfigChange + + - apiVersion: v1 + kind: Route + metadata: + name: "${APP_NAME}-frontend" + labels: + name: "${APP_NAME}-frontend" + app: ${APP_NAME} + app-group: ${APP_NAME} + spec: + host: ${APPLICATION_DOMAIN} + port: + targetPort: "${APP_NAME}-frontend" + tls: + insecureEdgeTerminationPolicy: Redirect + termination: edge + to: + kind: Service + name: "${APP_NAME}-frontend" + weight: 100 + + - apiVersion: v1 kind: Service metadata: - + labels: app: "${APP_NAME}" + name: "${APP_NAME}-frontend" + app-group: "${APP_NAME}" + template: "educ-${APP_NAME}-template" name: "${APP_NAME}-frontend" spec: ports: @@ -139,6 +167,8 @@ - apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: + labels: + template: "educ-${APP_NAME}-template" name: "${APP_NAME}-frontend-cpu-autoscaler" spec: scaleTargetRef: @@ -204,6 +234,11 @@ displayName: Dynamics API description: The endpoint for the internal Dynamics API component. required: true - value: "http://ecas-api:8080/api" + value: "http://ecas-api:8080/api" + - name: APPLICATION_DOMAIN + displayName: Application Hostname + description: The exposed hostname that will route to the service, if left blank a value will be defaulted. + required: false + value: "" From ba9aa2e15bec91936af05206ce52df3c5b7aa5b0 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:43:35 -0800 Subject: [PATCH 02/94] Add files via upload --- openshift/override-configmap-dev.sh | 66 ++++++++++++++++++++++++ openshift/update-configmap.sh | 79 +++++++++++++++++++++++++++++ 2 files changed, 145 insertions(+) create mode 100644 openshift/override-configmap-dev.sh create mode 100644 openshift/update-configmap.sh diff --git a/openshift/override-configmap-dev.sh b/openshift/override-configmap-dev.sh new file mode 100644 index 000000000..b970c5c61 --- /dev/null +++ b/openshift/override-configmap-dev.sh @@ -0,0 +1,66 @@ +########################################################### +#ENV VARS +########################################################### +envValue=$1 +APP_NAME=$2 +GRAD_NAMESPACE=$3 +COMMON_NAMESPACE=$4 +BUSINESS_NAMESPACE=$5 +SPLUNK_TOKEN=$6 +APP_LOG_LEVEL=$7 + +SPLUNK_URL="gww.splunk.educ.gov.bc.ca" +FLB_CONFIG="[SERVICE] + Flush 1 + Daemon Off + Log_Level info + HTTP_Server On + HTTP_Listen 0.0.0.0 + Parsers_File parsers.conf +[INPUT] + Name tail + Path /mnt/log/* + Exclude_Path *.gz,*.zip + Parser docker + Mem_Buf_Limit 20MB +[FILTER] + Name record_modifier + Match * + Record hostname \${HOSTNAME} +[OUTPUT] + Name stdout + Match absolutely_nothing_bud + Log_Level off +" +PARSER_CONFIG=" +[PARSER] + Name docker + Format json +" +########################################################### +#Override config-maps in DEV +########################################################### +echo Creating config map "$APP_NAME"-config-map +oc create -n "$GRAD_NAMESPACE"-"$envValue" configmap "$APP_NAME"-config-map \ + --from-literal=APP_LOG_LEVEL="$APP_LOG_LEVEL" \ + --from-literal=CONNECTION_TIMEOUT="60000" \ + --from-literal=EDUC_SCHOOL_API="http://school-api-master.$COMMON_NAMESPACE-$envValue.svc.cluster.local:8080/" \ + --from-literal=ENABLE_FLYWAY="true" \ + --from-literal=ENABLE_SPLUNK_LOG_HELPER="false" \ + --from-literal=ENABLE_STUDENT_ID_PEN_XREF="true" \ + --from-literal=ENABLE_TRAX_UPDATE="true" \ + --from-literal=GRAD_GRADUATION_REPORT_API="http://educ-grad-graduation-report-api.$GRAD_NAMESPACE-$envValue.svc.cluster.local:8080/" \ + --from-literal=GRAD_PROGRAM_API="http://educ-grad-program-api.$GRAD_NAMESPACE-$envValue.svc.cluster.local:8080/" \ + --from-literal=GRAD_STUDENT_GRADUATION_API="http://educ-grad-student-graduation-api.$GRAD_NAMESPACE-$envValue.svc.cluster.local:8080/" \ + --from-literal=GRAD_TRAX_API="http://educ-grad-trax-api.$GRAD_NAMESPACE-$envValue.svc.cluster.local:8080/"\ + --from-literal=MAXIMUM_POOL_SIZE="20" \ + --from-literal=MAX_RETRY_ATTEMPTS="3" \ + --from-literal=PEN_API="http://student-api-master.$COMMON_NAMESPACE-$envValue.svc.cluster.local:8080/" \ + --from-literal=CRON_SCHEDULED_REFRESH_NON_GRAD_STATUS="0 0 0 1 * ?" \ + --dry-run=client -o yaml | oc apply -f - + +echo Creating config map "$APP_NAME"-flb-sc-config-map +oc create -n "$GRAD_NAMESPACE"-"$envValue" configmap "$APP_NAME"-flb-sc-config-map \ + --from-literal=fluent-bit.conf="$FLB_CONFIG" \ + --from-literal=parsers.conf="$PARSER_CONFIG" \ + --dry-run=client -o yaml | oc apply -f - diff --git a/openshift/update-configmap.sh b/openshift/update-configmap.sh new file mode 100644 index 000000000..4556048f9 --- /dev/null +++ b/openshift/update-configmap.sh @@ -0,0 +1,79 @@ +########################################################### +#ENV VARS +########################################################### +envValue=$1 +APP_NAME=$2 +GRAD_NAMESPACE=$3 +COMMON_NAMESPACE=$4 +BUSINESS_NAMESPACE=$5 +SPLUNK_TOKEN=$6 +APP_LOG_LEVEL=$7 + +SPLUNK_URL="gww.splunk.educ.gov.bc.ca" +FLB_CONFIG="[SERVICE] + Flush 1 + Daemon Off + Log_Level info + HTTP_Server On + HTTP_Listen 0.0.0.0 + Parsers_File parsers.conf +[INPUT] + Name tail + Path /mnt/log/* + Exclude_Path *.gz,*.zip + Parser docker + Mem_Buf_Limit 20MB + Buffer_Max_Size 1MB +[FILTER] + Name record_modifier + Match * + Record hostname \${HOSTNAME} +[OUTPUT] + Name stdout + Match absolutely_nothing_bud + Log_Level off +[OUTPUT] + Name splunk + Match * + Host $SPLUNK_URL + Port 443 + TLS On + TLS.Verify Off + Message_Key $APP_NAME + Splunk_Token $SPLUNK_TOKEN +" +PARSER_CONFIG=" +[PARSER] + Name docker + Format json +" +########################################################### +#Setup for config-maps +########################################################### +echo Creating config map "$APP_NAME"-config-map +oc create -n "$GRAD_NAMESPACE"-"$envValue" configmap "$APP_NAME"-config-map \ + --from-literal=APP_LOG_LEVEL="$APP_LOG_LEVEL" \ + --from-literal=EDUC_SCHOOL_API="http://school-api-master.$COMMON_NAMESPACE-$envValue.svc.cluster.local:8080/" \ + --from-literal=ENABLE_FLYWAY="true" \ + --from-literal=ENABLE_SPLUNK_LOG_HELPER="true" \ + --from-literal=ENABLE_STUDENT_ID_PEN_XREF="true" \ + --from-literal=ENABLE_TRAX_UPDATE="true" \ + --from-literal=GRAD_GRADUATION_REPORT_API="http://educ-grad-graduation-report-api.$GRAD_NAMESPACE-$envValue.svc.cluster.local:8080/" \ + --from-literal=GRAD_PROGRAM_API="http://educ-grad-program-api.$GRAD_NAMESPACE-$envValue.svc.cluster.local:8080/" \ + --from-literal=GRAD_STUDENT_GRADUATION_API="http://educ-grad-student-graduation-api.$GRAD_NAMESPACE-$envValue.svc.cluster.local:8080/" \ + --from-literal=GRAD_TRAX_API="http://educ-grad-trax-api.$GRAD_NAMESPACE-$envValue.svc.cluster.local:8080/"\ + --from-literal=MAX_RETRY_ATTEMPTS="3" \ + --from-literal=PEN_API="http://student-api-master.$COMMON_NAMESPACE-$envValue.svc.cluster.local:8080/" \ + --from-literal=CRON_SCHEDULED_REFRESH_NON_GRAD_STATUS="0 0 0 1 * ?" \ + --from-literal=CONNECTION_TIMEOUT='60000' \ + --from-literal=MAXIMUM_POOL_SIZE='20' \ + --from-literal=MIN_IDLE='20' \ + --from-literal=IDLE_TIMEOUT='300000' \ + --from-literal=MAX_LIFETIME='1500000' \ + --dry-run=client -o yaml | oc apply -f - + +echo Creating config map "$APP_NAME"-flb-sc-config-map +oc create -n "$GRAD_NAMESPACE"-"$envValue" configmap "$APP_NAME"-flb-sc-config-map \ + --from-literal=fluent-bit.conf="$FLB_CONFIG" \ + --from-literal=parsers.conf="$PARSER_CONFIG" \ + --dry-run=client -o yaml | oc apply -f - From 19316a11ceb0ea3d6ad06f0618e8b58922eba033 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:18:32 -0800 Subject: [PATCH 03/94] Update override-configmap-dev.sh --- openshift/override-configmap-dev.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/openshift/override-configmap-dev.sh b/openshift/override-configmap-dev.sh index b970c5c61..561a0b7e5 100644 --- a/openshift/override-configmap-dev.sh +++ b/openshift/override-configmap-dev.sh @@ -1,13 +1,12 @@ ########################################################### #ENV VARS ########################################################### -envValue=$1 -APP_NAME=$2 -GRAD_NAMESPACE=$3 -COMMON_NAMESPACE=$4 -BUSINESS_NAMESPACE=$5 -SPLUNK_TOKEN=$6 -APP_LOG_LEVEL=$7 +APP_NAME=$1 +NAMESPACE=$2 +APP_DEBUG=$3 +DOCUMENTROOT=$4 +DYNAMICSBASEURL=$5 + SPLUNK_URL="gww.splunk.educ.gov.bc.ca" FLB_CONFIG="[SERVICE] @@ -41,7 +40,7 @@ PARSER_CONFIG=" #Override config-maps in DEV ########################################################### echo Creating config map "$APP_NAME"-config-map -oc create -n "$GRAD_NAMESPACE"-"$envValue" configmap "$APP_NAME"-config-map \ +oc create -n "$NAMESPACE" configmap "$APP_NAME"-config-map \ --from-literal=APP_LOG_LEVEL="$APP_LOG_LEVEL" \ --from-literal=CONNECTION_TIMEOUT="60000" \ --from-literal=EDUC_SCHOOL_API="http://school-api-master.$COMMON_NAMESPACE-$envValue.svc.cluster.local:8080/" \ From b9839eac833d322fd210c3e853f59657012cafe8 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:19:24 -0800 Subject: [PATCH 04/94] Update update-configmap.sh --- openshift/update-configmap.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/openshift/update-configmap.sh b/openshift/update-configmap.sh index 4556048f9..b83e2d8f0 100644 --- a/openshift/update-configmap.sh +++ b/openshift/update-configmap.sh @@ -1,13 +1,11 @@ ########################################################### #ENV VARS ########################################################### -envValue=$1 -APP_NAME=$2 -GRAD_NAMESPACE=$3 -COMMON_NAMESPACE=$4 -BUSINESS_NAMESPACE=$5 -SPLUNK_TOKEN=$6 -APP_LOG_LEVEL=$7 +APP_NAME=$1 +NAMESPACE=$2 +APP_DEBUG=$3 +DOCUMENTROOT=$4 +DYNAMICSBASEURL=$5 SPLUNK_URL="gww.splunk.educ.gov.bc.ca" FLB_CONFIG="[SERVICE] @@ -51,7 +49,7 @@ PARSER_CONFIG=" #Setup for config-maps ########################################################### echo Creating config map "$APP_NAME"-config-map -oc create -n "$GRAD_NAMESPACE"-"$envValue" configmap "$APP_NAME"-config-map \ +oc create -n "$NAMESPACE" configmap "$APP_NAME"-config-map \ --from-literal=APP_LOG_LEVEL="$APP_LOG_LEVEL" \ --from-literal=EDUC_SCHOOL_API="http://school-api-master.$COMMON_NAMESPACE-$envValue.svc.cluster.local:8080/" \ --from-literal=ENABLE_FLYWAY="true" \ From 2f654c257fd46c1c4b7fc360839081dedef7cae2 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:23:23 -0800 Subject: [PATCH 05/94] Update update-configmap.sh --- openshift/update-configmap.sh | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/openshift/update-configmap.sh b/openshift/update-configmap.sh index b83e2d8f0..a77a55b9d 100644 --- a/openshift/update-configmap.sh +++ b/openshift/update-configmap.sh @@ -50,28 +50,14 @@ PARSER_CONFIG=" ########################################################### echo Creating config map "$APP_NAME"-config-map oc create -n "$NAMESPACE" configmap "$APP_NAME"-config-map \ - --from-literal=APP_LOG_LEVEL="$APP_LOG_LEVEL" \ - --from-literal=EDUC_SCHOOL_API="http://school-api-master.$COMMON_NAMESPACE-$envValue.svc.cluster.local:8080/" \ - --from-literal=ENABLE_FLYWAY="true" \ - --from-literal=ENABLE_SPLUNK_LOG_HELPER="true" \ - --from-literal=ENABLE_STUDENT_ID_PEN_XREF="true" \ - --from-literal=ENABLE_TRAX_UPDATE="true" \ - --from-literal=GRAD_GRADUATION_REPORT_API="http://educ-grad-graduation-report-api.$GRAD_NAMESPACE-$envValue.svc.cluster.local:8080/" \ - --from-literal=GRAD_PROGRAM_API="http://educ-grad-program-api.$GRAD_NAMESPACE-$envValue.svc.cluster.local:8080/" \ - --from-literal=GRAD_STUDENT_GRADUATION_API="http://educ-grad-student-graduation-api.$GRAD_NAMESPACE-$envValue.svc.cluster.local:8080/" \ - --from-literal=GRAD_TRAX_API="http://educ-grad-trax-api.$GRAD_NAMESPACE-$envValue.svc.cluster.local:8080/"\ - --from-literal=MAX_RETRY_ATTEMPTS="3" \ - --from-literal=PEN_API="http://student-api-master.$COMMON_NAMESPACE-$envValue.svc.cluster.local:8080/" \ - --from-literal=CRON_SCHEDULED_REFRESH_NON_GRAD_STATUS="0 0 0 1 * ?" \ - --from-literal=CONNECTION_TIMEOUT='60000' \ - --from-literal=MAXIMUM_POOL_SIZE='20' \ - --from-literal=MIN_IDLE='20' \ - --from-literal=IDLE_TIMEOUT='300000' \ - --from-literal=MAX_LIFETIME='1500000' \ + --from-literal=APP_DEBUG="$APP_DEBUG" \ + --from-literal=DOCUMENTROOT="$DOCUMENTROOT" \ + --from-literal=DYNAMICSBASEURL="$DYNAMICSBASEURL" \ + --dry-run=client -o yaml | oc apply -f - echo Creating config map "$APP_NAME"-flb-sc-config-map -oc create -n "$GRAD_NAMESPACE"-"$envValue" configmap "$APP_NAME"-flb-sc-config-map \ +oc create -n "$NAMESPACE" configmap "$APP_NAME"-flb-sc-config-map \ --from-literal=fluent-bit.conf="$FLB_CONFIG" \ --from-literal=parsers.conf="$PARSER_CONFIG" \ --dry-run=client -o yaml | oc apply -f - From 0d4106670ee4dfb5e6602d68a4040f202802b73f Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:26:20 -0800 Subject: [PATCH 06/94] Update override-configmap-dev.sh --- openshift/override-configmap-dev.sh | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/openshift/override-configmap-dev.sh b/openshift/override-configmap-dev.sh index 561a0b7e5..fdd445d7f 100644 --- a/openshift/override-configmap-dev.sh +++ b/openshift/override-configmap-dev.sh @@ -41,25 +41,13 @@ PARSER_CONFIG=" ########################################################### echo Creating config map "$APP_NAME"-config-map oc create -n "$NAMESPACE" configmap "$APP_NAME"-config-map \ - --from-literal=APP_LOG_LEVEL="$APP_LOG_LEVEL" \ - --from-literal=CONNECTION_TIMEOUT="60000" \ - --from-literal=EDUC_SCHOOL_API="http://school-api-master.$COMMON_NAMESPACE-$envValue.svc.cluster.local:8080/" \ - --from-literal=ENABLE_FLYWAY="true" \ - --from-literal=ENABLE_SPLUNK_LOG_HELPER="false" \ - --from-literal=ENABLE_STUDENT_ID_PEN_XREF="true" \ - --from-literal=ENABLE_TRAX_UPDATE="true" \ - --from-literal=GRAD_GRADUATION_REPORT_API="http://educ-grad-graduation-report-api.$GRAD_NAMESPACE-$envValue.svc.cluster.local:8080/" \ - --from-literal=GRAD_PROGRAM_API="http://educ-grad-program-api.$GRAD_NAMESPACE-$envValue.svc.cluster.local:8080/" \ - --from-literal=GRAD_STUDENT_GRADUATION_API="http://educ-grad-student-graduation-api.$GRAD_NAMESPACE-$envValue.svc.cluster.local:8080/" \ - --from-literal=GRAD_TRAX_API="http://educ-grad-trax-api.$GRAD_NAMESPACE-$envValue.svc.cluster.local:8080/"\ - --from-literal=MAXIMUM_POOL_SIZE="20" \ - --from-literal=MAX_RETRY_ATTEMPTS="3" \ - --from-literal=PEN_API="http://student-api-master.$COMMON_NAMESPACE-$envValue.svc.cluster.local:8080/" \ - --from-literal=CRON_SCHEDULED_REFRESH_NON_GRAD_STATUS="0 0 0 1 * ?" \ + --from-literal=APP_DEBUG="$APP_DEBUG" \ + --from-literal=DOCUMENTROOT="$DOCUMENTROOT" \ + --from-literal=DYNAMICSBASEURL="$DYNAMICSBASEURL" \ --dry-run=client -o yaml | oc apply -f - echo Creating config map "$APP_NAME"-flb-sc-config-map -oc create -n "$GRAD_NAMESPACE"-"$envValue" configmap "$APP_NAME"-flb-sc-config-map \ +oc create -n "$NAMESPACE"-"$envValue" configmap "$APP_NAME"-flb-sc-config-map \ --from-literal=fluent-bit.conf="$FLB_CONFIG" \ --from-literal=parsers.conf="$PARSER_CONFIG" \ --dry-run=client -o yaml | oc apply -f - From 063119fd211cceba4d0741bf76037d0d60e1be58 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:30:02 -0800 Subject: [PATCH 07/94] Update build.from.master.branch.deploy.to.dev.yml --- ...build.from.master.branch.deploy.to.dev.yml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 5768980ea..2505cd70c 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -30,6 +30,9 @@ env: MAX_CPU: 600m MIN_MEM: 250Mi MAX_MEM: 500Mi + APP_DEBUG: false + DYNAMICSBASEURL: http://ecas-api:8080/api + DOCUMENTROOT: /public HOST_ROUTE: '${{ secrets.SITE_URL }}' @@ -244,6 +247,25 @@ jobs: oc process -f ./openshift/templates/cas-api/cas-api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }}\ | oc apply -f - + # UPDATE Configmaps + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/tools/update-configmap.sh \ + | bash /dev/stdin \ + ${{ env.REPO_NAME }} \ + ${{ env.OPENSHIFT_NAMESPACE_DEV }} \ + ${{ env.APP_DEBUG }} \ + ${{ env.DOCUMENTROOT }} \ + ${{ env.DYNAMICSBASEURL }} \ + + + # OVERRIDE Configmaps + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/tools/override-configmap-dev.sh \ + | bash /dev/stdin \ + ${{ env.REPO_NAME }} \ + ${{ env.OPENSHIFT_NAMESPACE_DEV}} \ + ${{ env.APP_DEBUG }} \ + ${{ env.DOCUMENTROOT }} \ + ${{ env.DYNAMICSBASEURL }} \ + From 64023979a66259636e4ae9e0ada5557cbceefb57 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:37:49 -0800 Subject: [PATCH 08/94] Update frontend.dc.yaml --- .../templates/ecas-frontend/frontend.dc.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/openshift/templates/ecas-frontend/frontend.dc.yaml b/openshift/templates/ecas-frontend/frontend.dc.yaml index cea35d904..f81253399 100644 --- a/openshift/templates/ecas-frontend/frontend.dc.yaml +++ b/openshift/templates/ecas-frontend/frontend.dc.yaml @@ -43,11 +43,20 @@ name: "${APP_NAME}-frontend" env: - name: APP_DEBUG - value: ${APP_DEBUG} + valueFrom: + secretKeyRef: + name: ${REPO_NAME}-config-map + key: APP_DEBUG - name: DYNAMICSBASEURL - value: ${DYNAMICSBASEURL} + valueFrom: + secretKeyRef: + name: ${REPO_NAME}-config-map + key: DYNAMICSBASEURL - name: DOCUMENTROOT - value: ${DOCUMENTROOT} + valueFrom: + secretKeyRef: + name: ${REPO_NAME}-config-map + key: DOCUMENTROOT - name: DYNAMICS_USERNAME valueFrom: secretKeyRef: From 9c0fcf71ef57036fb96de9886cf9897a7dcc15ba Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:44:34 -0800 Subject: [PATCH 09/94] Update build.from.master.branch.deploy.to.dev.yml --- ...build.from.master.branch.deploy.to.dev.yml | 70 ++++++++++--------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 2505cd70c..2d4f12528 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -33,6 +33,7 @@ env: APP_DEBUG: false DYNAMICSBASEURL: http://ecas-api:8080/api DOCUMENTROOT: /public + BRANCH: Github_action_fixes HOST_ROUTE: '${{ secrets.SITE_URL }}' @@ -40,7 +41,7 @@ env: workflow_dispatch: push: branches: - - master + - '${{ BRANCH }}' @@ -126,6 +127,7 @@ jobs: run: git clone '${{ env.SOURCE_REPOSITORY }}' - name: Setup and Build cas api + if: false id: build-image-cas uses: redhat-actions/s2i-build@v2 with: @@ -136,6 +138,7 @@ jobs: env_vars: | DOTNET_STARTUP_PROJECT=${{env.DOTNET_STARTUP_PROJECT}} - name: Setup and Build ecas api + if: false id: build-image-api uses: redhat-actions/s2i-build@v2 with: @@ -173,6 +176,7 @@ jobs: username: ${{ env.IMAGE_REGISTRY_USER }} password: ${{ env.IMAGE_REGISTRY_PASSWORD }} - name: Push api to registry + if: false id: push-image-api uses: redhat-actions/push-to-registry@v2 with: @@ -182,6 +186,7 @@ jobs: username: ${{ env.IMAGE_REGISTRY_USER }} password: ${{ env.IMAGE_REGISTRY_PASSWORD }} - name: Push cas to registry + if: false id: push-image-cas uses: redhat-actions/push-to-registry@v2 with: @@ -208,45 +213,28 @@ jobs: oc rollout cancel dc/${{ env.APP_NAME_FRONTEND }} 2> /dev/null || true && echo "No rollout in progress" - oc rollout cancel dc/${{ env.APP_NAME_API }} 2> /dev/null || true && echo "No ecas api rollout in progress" + #oc rollout cancel dc/${{ env.APP_NAME_API }} 2> /dev/null || true && echo "No ecas api rollout in progress" - oc rollout cancel dc/${{ env.APP_NAME_CAS }} 2> /dev/null || true && echo "No cas api rollout in progress" + #oc rollout cancel dc/${{ env.APP_NAME_CAS }} 2> /dev/null || true && echo "No cas api rollout in progress" # Create the image stream if it doesn't exist oc create imagestream ${{ env.REPO_NAME }}-frontend> /dev/null || true && echo "Frontend image stream in place" - oc create imagestream ${{ env.REPO_NAME }}-api> /dev/null || true && echo "Ecas API image stream in place" - oc create imagestream ${{ env.REPO_NAME }}-cas-api> /dev/null || true && echo "CAS API image stream in place" + #oc create imagestream ${{ env.REPO_NAME }}-api> /dev/null || true && echo "Ecas API image stream in place" + #oc create imagestream ${{ env.REPO_NAME }}-cas-api> /dev/null || true && echo "CAS API image stream in place" oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-frontend.outputs.registry-path }} ${{ env.REPO_NAME }}-frontend:${{ env.TAG }} echo "Frontend tag success" - oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-api.outputs.registry-path }} ${{env.REPO_NAME }}-api:${{ env.TAG }} + #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-api.outputs.registry-path }} ${{env.REPO_NAME }}-api:${{ env.TAG }} echo "Ecas API tag success" - oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} - - - echo "CAS API tag success" - - # Process and apply deployment template + #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} - oc process -f ./openshift/templates/ecas-frontend/frontend.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE}}\ - | oc apply -f - - - - - oc process -f ./openshift/templates/ecas-api/api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }} -p ASPNETCORE_ENVIRONMENT=${{ env.ASPNETCORE_ENVIRONMENT }}\ - | oc apply -f - - - - oc process -f ./openshift/templates/cas-api/cas-api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }}\ - | oc apply -f - - # UPDATE Configmaps curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/tools/update-configmap.sh \ | bash /dev/stdin \ @@ -266,6 +254,24 @@ jobs: ${{ env.DOCUMENTROOT }} \ ${{ env.DYNAMICSBASEURL }} \ + + echo "CAS API tag success" + + # Process and apply deployment template + + oc process -f ./openshift/templates/ecas-frontend/frontend.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE}}\ + | oc apply -f - + + + + #oc process -f ./openshift/templates/ecas-api/api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }} -p ASPNETCORE_ENVIRONMENT=${{ env.ASPNETCORE_ENVIRONMENT }}\ + #| oc apply -f - + + + #oc process -f ./openshift/templates/cas-api/cas-api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }}\ + #| oc apply -f - + + @@ -277,27 +283,27 @@ jobs: || true && echo "Rollout Front End in progress" - oc rollout latest dc/${{ env.APP_NAME_API }} 2> /dev/null \ + #oc rollout latest dc/${{ env.APP_NAME_API }} 2> /dev/null \ - || true && echo "Rollout ECAS API in progress" + #|| true && echo "Rollout ECAS API in progress" - oc rollout latest dc/${{ env.APP_NAME_CAS }} 2> /dev/null \ + #oc rollout latest dc/${{ env.APP_NAME_CAS }} 2> /dev/null \ - || true && echo "Rollout CAS API in progress" + #|| true && echo "Rollout CAS API in progress" oc logs dc/${{ env.APP_NAME_FRONTEND }} - oc logs dc/${{ env.APP_NAME_API }} + #oc logs dc/${{ env.APP_NAME_API }} - oc logs dc/${{ env.APP_NAME_CAS }} + #oc logs dc/${{ env.APP_NAME_CAS }} # Get status, returns 0 if rollout is successful oc rollout status dc/${{ env.APP_NAME_FRONTEND }} - oc rollout status dc/${{ env.APP_NAME_API }} + #oc rollout status dc/${{ env.APP_NAME_API }} - oc rollout status dc/${{ env.APP_NAME_CAS }} + #oc rollout status dc/${{ env.APP_NAME_CAS }} - name: ZAP Scan From 8175472bd32f46a6620e6b325f4abe943c398d75 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:46:28 -0800 Subject: [PATCH 10/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 2d4f12528..c6492f78e 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -33,7 +33,7 @@ env: APP_DEBUG: false DYNAMICSBASEURL: http://ecas-api:8080/api DOCUMENTROOT: /public - BRANCH: Github_action_fixes + BRANCH: github_action_fixes HOST_ROUTE: '${{ secrets.SITE_URL }}' From 85b431203b51d4dda1fd660a0c3c88743b1b29b4 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:47:16 -0800 Subject: [PATCH 11/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index c6492f78e..bc6dad352 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -41,7 +41,7 @@ env: workflow_dispatch: push: branches: - - '${{ BRANCH }}' + - Github_action_fixes From 175d6cddeaee4a4ea6797b701a0d25d1c6181e70 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:52:40 -0800 Subject: [PATCH 12/94] Update frontend.dc.yaml --- openshift/templates/ecas-frontend/frontend.dc.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/openshift/templates/ecas-frontend/frontend.dc.yaml b/openshift/templates/ecas-frontend/frontend.dc.yaml index f81253399..4d6519852 100644 --- a/openshift/templates/ecas-frontend/frontend.dc.yaml +++ b/openshift/templates/ecas-frontend/frontend.dc.yaml @@ -10,7 +10,6 @@ - apiVersion: v1 kind: DeploymentConfig metadata: - creationTimestamp: labels: app: "${APP_NAME}" From 34f79c91858e660d2c253b6ca2d9b5697a770e97 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 17:28:08 -0800 Subject: [PATCH 13/94] Update build.from.master.branch.deploy.to.dev.yml --- .../build.from.master.branch.deploy.to.dev.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index bc6dad352..e1fa34723 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -33,7 +33,7 @@ env: APP_DEBUG: false DYNAMICSBASEURL: http://ecas-api:8080/api DOCUMENTROOT: /public - BRANCH: github_action_fixes + HOST_ROUTE: '${{ secrets.SITE_URL }}' @@ -235,8 +235,9 @@ jobs: #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} - # UPDATE Configmaps - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/tools/update-configmap.sh \ + + + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/refs/heads/github_action_fixes/tools/update-configmap.sh \ | bash /dev/stdin \ ${{ env.REPO_NAME }} \ ${{ env.OPENSHIFT_NAMESPACE_DEV }} \ @@ -245,8 +246,8 @@ jobs: ${{ env.DYNAMICSBASEURL }} \ - # OVERRIDE Configmaps - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/tools/override-configmap-dev.sh \ + + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/refs/heads/github_action_fixes/tools/update-configmap.sh \ | bash /dev/stdin \ ${{ env.REPO_NAME }} \ ${{ env.OPENSHIFT_NAMESPACE_DEV}} \ From b98b8313122e9af953585fc615fc1688943a0f7d Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 17:44:11 -0800 Subject: [PATCH 14/94] Rename override-configmap-dev.sh to override-configmap.sh --- openshift/{override-configmap-dev.sh => override-configmap.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename openshift/{override-configmap-dev.sh => override-configmap.sh} (100%) diff --git a/openshift/override-configmap-dev.sh b/openshift/override-configmap.sh similarity index 100% rename from openshift/override-configmap-dev.sh rename to openshift/override-configmap.sh From 9a242460c5febf37755f6cdf168f53bfbac78d09 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 17:47:36 -0800 Subject: [PATCH 15/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index e1fa34723..b2b97f0f4 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -247,7 +247,7 @@ jobs: - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/refs/heads/github_action_fixes/tools/update-configmap.sh \ + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/refs/heads/github_action_fixes/tools/override-configmap.sh \ | bash /dev/stdin \ ${{ env.REPO_NAME }} \ ${{ env.OPENSHIFT_NAMESPACE_DEV}} \ From 8fa9a8629bad8f1b281f45b74dee4e8f3f6d0fb4 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 18:01:45 -0800 Subject: [PATCH 16/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index b2b97f0f4..9df4cb376 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -237,7 +237,7 @@ jobs: - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/refs/heads/github_action_fixes/tools/update-configmap.sh \ + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/refs/heads/github_action_fixes/openshift/update-configmap.sh \ | bash /dev/stdin \ ${{ env.REPO_NAME }} \ ${{ env.OPENSHIFT_NAMESPACE_DEV }} \ @@ -247,7 +247,7 @@ jobs: - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/refs/heads/github_action_fixes/tools/override-configmap.sh \ + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/refs/heads/github_action_fixes/openshift/override-configmap.sh \ | bash /dev/stdin \ ${{ env.REPO_NAME }} \ ${{ env.OPENSHIFT_NAMESPACE_DEV}} \ From 1cb6056aa4a60ca8042ed7f7608a550ee4c41e30 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 18:13:32 -0800 Subject: [PATCH 17/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 9df4cb376..0e86bb5e9 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -237,7 +237,7 @@ jobs: - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/refs/heads/github_action_fixes/openshift/update-configmap.sh \ + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/refs/heads/github_action_fixes/openshift/update-configmap.sh\ | bash /dev/stdin \ ${{ env.REPO_NAME }} \ ${{ env.OPENSHIFT_NAMESPACE_DEV }} \ @@ -247,7 +247,7 @@ jobs: - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/refs/heads/github_action_fixes/openshift/override-configmap.sh \ + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/refs/heads/github_action_fixes/openshift/override-configmap.sh\ | bash /dev/stdin \ ${{ env.REPO_NAME }} \ ${{ env.OPENSHIFT_NAMESPACE_DEV}} \ From 805f8017c2961ba32d6c5bc9ba9fa3f9bef49568 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 18:29:33 -0800 Subject: [PATCH 18/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 0e86bb5e9..72d1374c5 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -237,7 +237,7 @@ jobs: - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/refs/heads/github_action_fixes/openshift/update-configmap.sh\ + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/github_action_fixes/openshift/update-configmap.sh\ | bash /dev/stdin \ ${{ env.REPO_NAME }} \ ${{ env.OPENSHIFT_NAMESPACE_DEV }} \ @@ -247,7 +247,7 @@ jobs: - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/refs/heads/github_action_fixes/openshift/override-configmap.sh\ + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/github_action_fixes/openshift/override-configmap.sh\ | bash /dev/stdin \ ${{ env.REPO_NAME }} \ ${{ env.OPENSHIFT_NAMESPACE_DEV}} \ From ef29be98e7933993cdc670cec01855cc3ae54b53 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 18:32:01 -0800 Subject: [PATCH 19/94] Update build.from.master.branch.deploy.to.dev.yml --- .../workflows/build.from.master.branch.deploy.to.dev.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 72d1374c5..5c9d1e936 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -237,23 +237,23 @@ jobs: - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/github_action_fixes/openshift/update-configmap.sh\ + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/github_action_fixes/openshift/update-configmap.sh \ | bash /dev/stdin \ ${{ env.REPO_NAME }} \ ${{ env.OPENSHIFT_NAMESPACE_DEV }} \ ${{ env.APP_DEBUG }} \ ${{ env.DOCUMENTROOT }} \ - ${{ env.DYNAMICSBASEURL }} \ + ${{ env.DYNAMICSBASEURL }} - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/github_action_fixes/openshift/override-configmap.sh\ + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/github_action_fixes/openshift/override-configmap.sh \ | bash /dev/stdin \ ${{ env.REPO_NAME }} \ ${{ env.OPENSHIFT_NAMESPACE_DEV}} \ ${{ env.APP_DEBUG }} \ ${{ env.DOCUMENTROOT }} \ - ${{ env.DYNAMICSBASEURL }} \ + ${{ env.DYNAMICSBASEURL }} echo "CAS API tag success" From 537beba36f2e3e6aab8d6ce72fb94453c6ee0916 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 18:44:36 -0800 Subject: [PATCH 20/94] Update build.from.master.branch.deploy.to.dev.yml From 20767d8740ba7511d28a4a96ffd011b97c8b2834 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 19:01:35 -0800 Subject: [PATCH 21/94] Update build.from.master.branch.deploy.to.dev.yml --- ...build.from.master.branch.deploy.to.dev.yml | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 5c9d1e936..df1aa16f5 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -227,36 +227,23 @@ jobs: oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-frontend.outputs.registry-path }} ${{ env.REPO_NAME }}-frontend:${{ env.TAG }} - echo "Frontend tag success" #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-api.outputs.registry-path }} ${{env.REPO_NAME }}-api:${{ env.TAG }} - echo "Ecas API tag success" + #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} - - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/github_action_fixes/openshift/update-configmap.sh \ - | bash /dev/stdin \ - ${{ env.REPO_NAME }} \ - ${{ env.OPENSHIFT_NAMESPACE_DEV }} \ - ${{ env.APP_DEBUG }} \ - ${{ env.DOCUMENTROOT }} \ - ${{ env.DYNAMICSBASEURL }} + + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/github_action_fixes/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/github_action_fixes/openshift/override-configmap.sh \ - | bash /dev/stdin \ - ${{ env.REPO_NAME }} \ - ${{ env.OPENSHIFT_NAMESPACE_DEV}} \ - ${{ env.APP_DEBUG }} \ - ${{ env.DOCUMENTROOT }} \ - ${{ env.DYNAMICSBASEURL }} + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/github_action_fixes/openshift/override-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV}} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} - echo "CAS API tag success" + # Process and apply deployment template From 92f7799fc902e080218ef329b97e5f71f222d1b6 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 19:20:41 -0800 Subject: [PATCH 22/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index df1aa16f5..b5a6e66e7 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -236,11 +236,11 @@ jobs: - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/github_action_fixes/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/Github_action_fixes/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/github_action_fixes/openshift/override-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV}} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/Github_action_fixes/openshift/override-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV}} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} From aefbef7e9cc0db94fef578dfef5b521d1fd66562 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 19:57:37 -0800 Subject: [PATCH 23/94] Update override-configmap.sh --- openshift/override-configmap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openshift/override-configmap.sh b/openshift/override-configmap.sh index fdd445d7f..e722995ad 100644 --- a/openshift/override-configmap.sh +++ b/openshift/override-configmap.sh @@ -47,7 +47,7 @@ oc create -n "$NAMESPACE" configmap "$APP_NAME"-config-map \ --dry-run=client -o yaml | oc apply -f - echo Creating config map "$APP_NAME"-flb-sc-config-map -oc create -n "$NAMESPACE"-"$envValue" configmap "$APP_NAME"-flb-sc-config-map \ +oc create -n "$NAMESPACE" configmap "$APP_NAME"-flb-sc-config-map \ --from-literal=fluent-bit.conf="$FLB_CONFIG" \ --from-literal=parsers.conf="$PARSER_CONFIG" \ --dry-run=client -o yaml | oc apply -f - From 957ad0956a7e960413d7aec9b6530bb8443bd0a2 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Thu, 21 Nov 2024 20:46:20 -0800 Subject: [PATCH 24/94] Update frontend.dc.yaml --- openshift/templates/ecas-frontend/frontend.dc.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openshift/templates/ecas-frontend/frontend.dc.yaml b/openshift/templates/ecas-frontend/frontend.dc.yaml index 4d6519852..1303f6ead 100644 --- a/openshift/templates/ecas-frontend/frontend.dc.yaml +++ b/openshift/templates/ecas-frontend/frontend.dc.yaml @@ -177,6 +177,9 @@ metadata: labels: template: "educ-${APP_NAME}-template" + app: "${APP_NAME}" + name: "${APP_NAME}-frontend" + app-group: "${APP_NAME}" name: "${APP_NAME}-frontend-cpu-autoscaler" spec: scaleTargetRef: From d58e4d850674ccef1333986d049fe8a56d556e01 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 07:50:13 -0800 Subject: [PATCH 25/94] Update frontend.dc.yaml --- openshift/templates/ecas-frontend/frontend.dc.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openshift/templates/ecas-frontend/frontend.dc.yaml b/openshift/templates/ecas-frontend/frontend.dc.yaml index 1303f6ead..f2409683d 100644 --- a/openshift/templates/ecas-frontend/frontend.dc.yaml +++ b/openshift/templates/ecas-frontend/frontend.dc.yaml @@ -43,17 +43,17 @@ env: - name: APP_DEBUG valueFrom: - secretKeyRef: + configMapKeyRef: name: ${REPO_NAME}-config-map key: APP_DEBUG - name: DYNAMICSBASEURL valueFrom: - secretKeyRef: + configMapKeyRef: name: ${REPO_NAME}-config-map key: DYNAMICSBASEURL - name: DOCUMENTROOT valueFrom: - secretKeyRef: + configMapKeyRef: name: ${REPO_NAME}-config-map key: DOCUMENTROOT - name: DYNAMICS_USERNAME From ef2a73a1917ad2d9f59ccdd88b4599b84072fdf8 Mon Sep 17 00:00:00 2001 From: cditcher Date: Fri, 22 Nov 2024 10:30:26 -0800 Subject: [PATCH 26/94] Minor refactoring --- ...build.from.master.branch.deploy.to.dev.yml | 86 +++++-------------- openshift/override-configmap.sh | 53 ------------ .../templates/ecas-frontend/frontend.dc.yaml | 28 +----- openshift/update-configmap.sh | 41 +-------- 4 files changed, 25 insertions(+), 183 deletions(-) delete mode 100644 openshift/override-configmap.sh diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index b5a6e66e7..af5bf1efc 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -33,27 +33,18 @@ env: APP_DEBUG: false DYNAMICSBASEURL: http://ecas-api:8080/api DOCUMENTROOT: /public - - - HOST_ROUTE: '${{ secrets.SITE_URL }}' -'on': + BRANCH: "Github_action_fixes" + +on: workflow_dispatch: - push: - branches: - - Github_action_fixes - - - - - + jobs: build-and-deploy-dev: name: Build and deploy to DEV runs-on: ubuntu-24.04 environment: dev - - + steps: - name: Check for required secrets uses: actions/github-script@v6 @@ -64,7 +55,6 @@ jobs: OPENSHIFT_TOKEN: `${{ secrets.OPENSHIFT_TOKEN }}`, }; - const GHCR = "ghcr.io"; if (`${{ env.IMAGE_REGISTRY }}`.startsWith(GHCR)) { @@ -76,7 +66,6 @@ jobs: secrets["IMAGE_REGISTRY_PASSWORD"] = `${{ secrets.IMAGE_REGISTRY_PASSWORD }}`; } - const missingSecrets = Object.entries(secrets).filter(([ name, value ]) => { if (value.length === 0) { @@ -87,7 +76,6 @@ jobs: return false; }); - if (missingSecrets.length > 0) { core.setFailed(`❌ At least one required secret is not set in the repository. \n` + "You can add it using:\n" + @@ -99,6 +87,7 @@ jobs: else { core.info(`✅ All the required secrets are set`); } + - name: Check out repository uses: actions/checkout@v3 @@ -111,18 +100,21 @@ jobs: uses: redhat-actions/openshift-tools-installer@v1 with: oc: 4 + - name: Login to Docker Hub uses: docker/login-action@v1 with: registry: '${{ env.DOCKER_ARTIFACTORY_REPO }}' username: '${{ secrets.DOCKER_HUB_USERNAME }}' password: '${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}' + - name: Login to REDHAT uses: docker/login-action@v1 with: registry: '${{ env.REDHAT_REGISTRY }}' username: '${{ secrets.REDHAT_REGISTRY_USERNAME }}' password: '${{ secrets.REDHAT_REGISTRY_PASSWORD }}' + - name: Check out repository run: git clone '${{ env.SOURCE_REPOSITORY }}' @@ -137,6 +129,7 @@ jobs: tags: ${{ env.TAG }} env_vars: | DOTNET_STARTUP_PROJECT=${{env.DOTNET_STARTUP_PROJECT}} + - name: Setup and Build ecas api if: false id: build-image-api @@ -146,6 +139,7 @@ jobs: builder_image: registry.redhat.io/rhel8/dotnet-60 image: '${{env.APP_NAME_API }}' tags: ${{ env.TAG }} + - name: Setup and Build Frontend id: build-image-frontend uses: redhat-actions/s2i-build@v2 @@ -154,6 +148,7 @@ jobs: builder_image: registry.redhat.io/rhscl/php-73-rhel7 image: '${{env.APP_NAME_FRONTEND }}' tags: ${{ env.TAG }} + - name: Login to Docker Hub uses: docker/login-action@v1 with: @@ -162,10 +157,7 @@ jobs: password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - name: List docker images run: docker images - - - - + - name: Push frontend to registry id: push-image-frontend uses: redhat-actions/push-to-registry@v2 @@ -175,6 +167,7 @@ jobs: registry: ${{ env.IMAGE_REGISTRY }} username: ${{ env.IMAGE_REGISTRY_USER }} password: ${{ env.IMAGE_REGISTRY_PASSWORD }} + - name: Push api to registry if: false id: push-image-api @@ -185,6 +178,7 @@ jobs: registry: ${{ env.IMAGE_REGISTRY }} username: ${{ env.IMAGE_REGISTRY_USER }} password: ${{ env.IMAGE_REGISTRY_PASSWORD }} + - name: Push cas to registry if: false id: push-image-cas @@ -195,78 +189,43 @@ jobs: registry: ${{ env.IMAGE_REGISTRY }} username: ${{ env.IMAGE_REGISTRY_USER }} password: ${{ env.IMAGE_REGISTRY_PASSWORD }} - - uses: actions/checkout@v3 - name: Deploy run: > set -eux - # Login to OpenShift and select project - - oc login --token=${{ env.OPENSHIFT_TOKEN }} --server=${{ - env.OPENSHIFT_SERVER }} - + # Login to OpenShift and select project + oc login --token=${{ env.OPENSHIFT_TOKEN }} --server=${{env.OPENSHIFT_SERVER }} oc project ${{ env.OPENSHIFT_NAMESPACE_DEV }} # Cancel any rollouts in progress - oc rollout cancel dc/${{ env.APP_NAME_FRONTEND }} 2> /dev/null || true && echo "No rollout in progress" - #oc rollout cancel dc/${{ env.APP_NAME_API }} 2> /dev/null || true && echo "No ecas api rollout in progress" - #oc rollout cancel dc/${{ env.APP_NAME_CAS }} 2> /dev/null || true && echo "No cas api rollout in progress" - # Create the image stream if it doesn't exist - oc create imagestream ${{ env.REPO_NAME }}-frontend> /dev/null || true && echo "Frontend image stream in place" #oc create imagestream ${{ env.REPO_NAME }}-api> /dev/null || true && echo "Ecas API image stream in place" #oc create imagestream ${{ env.REPO_NAME }}-cas-api> /dev/null || true && echo "CAS API image stream in place" - + # Tag images oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-frontend.outputs.registry-path }} ${{ env.REPO_NAME }}-frontend:${{ env.TAG }} - - #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-api.outputs.registry-path }} ${{env.REPO_NAME }}-api:${{ env.TAG }} - - - #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} - - - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/Github_action_fixes/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} - - - - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/Github_action_fixes/openshift/override-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV}} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} - - - - - # Process and apply deployment template + # Update configmap + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} + # Process and apply deployment template oc process -f ./openshift/templates/ecas-frontend/frontend.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE}}\ | oc apply -f - - - - #oc process -f ./openshift/templates/ecas-api/api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }} -p ASPNETCORE_ENVIRONMENT=${{ env.ASPNETCORE_ENVIRONMENT }}\ #| oc apply -f - - - #oc process -f ./openshift/templates/cas-api/cas-api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }}\ #| oc apply -f - - - - - - # Start rollout (if necessary) and follow it - - oc rollout latest dc/${{ env.APP_NAME_FRONTEND }} 2> /dev/null \ || true && echo "Rollout Front End in progress" @@ -292,8 +251,7 @@ jobs: #oc rollout status dc/${{ env.APP_NAME_API }} #oc rollout status dc/${{ env.APP_NAME_CAS }} - - + - name: ZAP Scan uses: zaproxy/action-full-scan@v0.7.0 with: diff --git a/openshift/override-configmap.sh b/openshift/override-configmap.sh deleted file mode 100644 index e722995ad..000000000 --- a/openshift/override-configmap.sh +++ /dev/null @@ -1,53 +0,0 @@ -########################################################### -#ENV VARS -########################################################### -APP_NAME=$1 -NAMESPACE=$2 -APP_DEBUG=$3 -DOCUMENTROOT=$4 -DYNAMICSBASEURL=$5 - - -SPLUNK_URL="gww.splunk.educ.gov.bc.ca" -FLB_CONFIG="[SERVICE] - Flush 1 - Daemon Off - Log_Level info - HTTP_Server On - HTTP_Listen 0.0.0.0 - Parsers_File parsers.conf -[INPUT] - Name tail - Path /mnt/log/* - Exclude_Path *.gz,*.zip - Parser docker - Mem_Buf_Limit 20MB -[FILTER] - Name record_modifier - Match * - Record hostname \${HOSTNAME} -[OUTPUT] - Name stdout - Match absolutely_nothing_bud - Log_Level off -" -PARSER_CONFIG=" -[PARSER] - Name docker - Format json -" -########################################################### -#Override config-maps in DEV -########################################################### -echo Creating config map "$APP_NAME"-config-map -oc create -n "$NAMESPACE" configmap "$APP_NAME"-config-map \ - --from-literal=APP_DEBUG="$APP_DEBUG" \ - --from-literal=DOCUMENTROOT="$DOCUMENTROOT" \ - --from-literal=DYNAMICSBASEURL="$DYNAMICSBASEURL" \ - --dry-run=client -o yaml | oc apply -f - - -echo Creating config map "$APP_NAME"-flb-sc-config-map -oc create -n "$NAMESPACE" configmap "$APP_NAME"-flb-sc-config-map \ - --from-literal=fluent-bit.conf="$FLB_CONFIG" \ - --from-literal=parsers.conf="$PARSER_CONFIG" \ - --dry-run=client -o yaml | oc apply -f - diff --git a/openshift/templates/ecas-frontend/frontend.dc.yaml b/openshift/templates/ecas-frontend/frontend.dc.yaml index f2409683d..4cb48a9a5 100644 --- a/openshift/templates/ecas-frontend/frontend.dc.yaml +++ b/openshift/templates/ecas-frontend/frontend.dc.yaml @@ -5,7 +5,6 @@ template: "${REPO_NAME}-template" metadata: name: "${REPO_NAME}-frontend-dc" - creationTimestamp: objects: - apiVersion: v1 kind: DeploymentConfig @@ -27,8 +26,6 @@ type: Rolling template: metadata: - - creationTimestamp: labels: app: "${APP_NAME}" deploymentconfig: "${APP_NAME}-frontend" @@ -36,9 +33,6 @@ containers: - image: image-registry.openshift-image-registry.svc:5000/${NAMESPACE}/${REPO_NAME}-frontend:${TAG} imagePullPolicy: Always - - - name: "${APP_NAME}-frontend" env: - name: APP_DEBUG @@ -90,11 +84,7 @@ valueFrom: secretKeyRef: name: ecas-frontend - key: API_KEY - - - - + key: API_KEY ports: - containerPort: 8080 protocol: TCP @@ -112,8 +102,6 @@ path: "/" port: 8080 scheme: HTTP - - resources: requests: cpu: "${MIN_CPU}" @@ -121,7 +109,6 @@ limits: cpu: "${MAX_CPU}" memory: "${MAX_MEM}" - test: false triggers: - type: ConfigChange @@ -150,7 +137,6 @@ - apiVersion: v1 kind: Service metadata: - labels: app: "${APP_NAME}" name: "${APP_NAME}-frontend" @@ -167,11 +153,6 @@ app: "${APP_NAME}" deploymentconfig: "${APP_NAME}-frontend" - - - - - - apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: @@ -200,7 +181,6 @@ - name: REPO_NAME description: Application repository name required: true - - name: NAMESPACE description: Target namespace reference (i.e. 'k8vopl-dev') required: true @@ -231,7 +211,6 @@ - name: MAX_MEM description: The maximum amount of memory required: true - - name: APP_DEBUG displayName: Application Debug required: true @@ -240,7 +219,6 @@ displayName: Document Root required: true value: "/public" - - name: DYNAMICSBASEURL displayName: Dynamics API description: The endpoint for the internal Dynamics API component. @@ -250,6 +228,4 @@ displayName: Application Hostname description: The exposed hostname that will route to the service, if left blank a value will be defaulted. required: false - value: "" - - + value: "" \ No newline at end of file diff --git a/openshift/update-configmap.sh b/openshift/update-configmap.sh index a77a55b9d..d6aaf069c 100644 --- a/openshift/update-configmap.sh +++ b/openshift/update-configmap.sh @@ -7,44 +7,6 @@ APP_DEBUG=$3 DOCUMENTROOT=$4 DYNAMICSBASEURL=$5 -SPLUNK_URL="gww.splunk.educ.gov.bc.ca" -FLB_CONFIG="[SERVICE] - Flush 1 - Daemon Off - Log_Level info - HTTP_Server On - HTTP_Listen 0.0.0.0 - Parsers_File parsers.conf -[INPUT] - Name tail - Path /mnt/log/* - Exclude_Path *.gz,*.zip - Parser docker - Mem_Buf_Limit 20MB - Buffer_Max_Size 1MB -[FILTER] - Name record_modifier - Match * - Record hostname \${HOSTNAME} -[OUTPUT] - Name stdout - Match absolutely_nothing_bud - Log_Level off -[OUTPUT] - Name splunk - Match * - Host $SPLUNK_URL - Port 443 - TLS On - TLS.Verify Off - Message_Key $APP_NAME - Splunk_Token $SPLUNK_TOKEN -" -PARSER_CONFIG=" -[PARSER] - Name docker - Format json -" ########################################################### #Setup for config-maps ########################################################### @@ -52,8 +14,7 @@ echo Creating config map "$APP_NAME"-config-map oc create -n "$NAMESPACE" configmap "$APP_NAME"-config-map \ --from-literal=APP_DEBUG="$APP_DEBUG" \ --from-literal=DOCUMENTROOT="$DOCUMENTROOT" \ - --from-literal=DYNAMICSBASEURL="$DYNAMICSBASEURL" \ - + --from-literal=DYNAMICSBASEURL="$DYNAMICSBASEURL" \ --dry-run=client -o yaml | oc apply -f - echo Creating config map "$APP_NAME"-flb-sc-config-map From 4de76f56da2e8045fea2a05416e8d64697aed5a1 Mon Sep 17 00:00:00 2001 From: cditcher Date: Fri, 22 Nov 2024 10:52:15 -0800 Subject: [PATCH 27/94] Minor refactoring --- .../workflows/build.from.master.branch.deploy.to.dev.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index af5bf1efc..2496ce2a5 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -200,7 +200,8 @@ jobs: oc project ${{ env.OPENSHIFT_NAMESPACE_DEV }} # Cancel any rollouts in progress - oc rollout cancel dc/${{ env.APP_NAME_FRONTEND }} 2> /dev/null || true && echo "No rollout in progress" + oc rollout cancel dc/${{ env.APP_NAME_FRONTEND }} 2> /dev/null \ + || true && echo "No rollout in progress" #oc rollout cancel dc/${{ env.APP_NAME_API }} 2> /dev/null || true && echo "No ecas api rollout in progress" #oc rollout cancel dc/${{ env.APP_NAME_CAS }} 2> /dev/null || true && echo "No cas api rollout in progress" @@ -215,7 +216,7 @@ jobs: #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} # Update configmap - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }}\ # Process and apply deployment template oc process -f ./openshift/templates/ecas-frontend/frontend.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE}}\ @@ -238,7 +239,7 @@ jobs: #|| true && echo "Rollout CAS API in progress" - oc logs dc/${{ env.APP_NAME_FRONTEND }} + oc logs dc/${{ env.APP_NAME_FRONTEND }} \ #oc logs dc/${{ env.APP_NAME_API }} @@ -246,7 +247,7 @@ jobs: # Get status, returns 0 if rollout is successful - oc rollout status dc/${{ env.APP_NAME_FRONTEND }} + oc rollout status dc/${{ env.APP_NAME_FRONTEND }} \ #oc rollout status dc/${{ env.APP_NAME_API }} From 456c8249e5b61514f9d6061cc8376f26263a3911 Mon Sep 17 00:00:00 2001 From: cditcher Date: Fri, 22 Nov 2024 10:56:23 -0800 Subject: [PATCH 28/94] Minor refactoring --- .../build.from.master.branch.deploy.to.dev.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 2496ce2a5..95d537499 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -202,13 +202,18 @@ jobs: # Cancel any rollouts in progress oc rollout cancel dc/${{ env.APP_NAME_FRONTEND }} 2> /dev/null \ || true && echo "No rollout in progress" - #oc rollout cancel dc/${{ env.APP_NAME_API }} 2> /dev/null || true && echo "No ecas api rollout in progress" - #oc rollout cancel dc/${{ env.APP_NAME_CAS }} 2> /dev/null || true && echo "No cas api rollout in progress" + #oc rollout cancel dc/${{ env.APP_NAME_API }} 2> /dev/null \ + #|| true && echo "No ecas api rollout in progress" + #oc rollout cancel dc/${{ env.APP_NAME_CAS }} 2> /dev/null | + #|| true && echo "No cas api rollout in progress" # Create the image stream if it doesn't exist - oc create imagestream ${{ env.REPO_NAME }}-frontend> /dev/null || true && echo "Frontend image stream in place" - #oc create imagestream ${{ env.REPO_NAME }}-api> /dev/null || true && echo "Ecas API image stream in place" - #oc create imagestream ${{ env.REPO_NAME }}-cas-api> /dev/null || true && echo "CAS API image stream in place" + oc create imagestream ${{ env.REPO_NAME }}-frontend> /dev/null \ + || true && echo "Frontend image stream in place" + #oc create imagestream ${{ env.REPO_NAME }}-api> /dev/null \ + #|| true && echo "Ecas API image stream in place" + #oc create imagestream ${{ env.REPO_NAME }}-cas-api> /dev/null \ + #|| true && echo "CAS API image stream in place" # Tag images oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-frontend.outputs.registry-path }} ${{ env.REPO_NAME }}-frontend:${{ env.TAG }} From 734157d93b50c7f6753645e16588e17392314dda Mon Sep 17 00:00:00 2001 From: cditcher Date: Fri, 22 Nov 2024 11:11:09 -0800 Subject: [PATCH 29/94] Rolled change back --- ...build.from.master.branch.deploy.to.dev.yml | 83 +++++++++---------- 1 file changed, 39 insertions(+), 44 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 95d537499..e41122fae 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -195,68 +195,63 @@ jobs: run: > set -eux - # Login to OpenShift and select project - oc login --token=${{ env.OPENSHIFT_TOKEN }} --server=${{env.OPENSHIFT_SERVER }} + # Login to OpenShift and select project + + oc login --token=${{ env.OPENSHIFT_TOKEN }} --server=${{ + env.OPENSHIFT_SERVER }} + oc project ${{ env.OPENSHIFT_NAMESPACE_DEV }} # Cancel any rollouts in progress - oc rollout cancel dc/${{ env.APP_NAME_FRONTEND }} 2> /dev/null \ - || true && echo "No rollout in progress" - #oc rollout cancel dc/${{ env.APP_NAME_API }} 2> /dev/null \ - #|| true && echo "No ecas api rollout in progress" - #oc rollout cancel dc/${{ env.APP_NAME_CAS }} 2> /dev/null | - #|| true && echo "No cas api rollout in progress" + + oc rollout cancel dc/${{ env.APP_NAME_FRONTEND }} 2> /dev/null || true && echo "No rollout in progress" + + #oc rollout cancel dc/${{ env.APP_NAME_API }} 2> /dev/null || true && echo "No ecas api rollout in progress" + + #oc rollout cancel dc/${{ env.APP_NAME_CAS }} 2> /dev/null || true && echo "No cas api rollout in progress" + # Create the image stream if it doesn't exist - oc create imagestream ${{ env.REPO_NAME }}-frontend> /dev/null \ - || true && echo "Frontend image stream in place" - #oc create imagestream ${{ env.REPO_NAME }}-api> /dev/null \ - #|| true && echo "Ecas API image stream in place" - #oc create imagestream ${{ env.REPO_NAME }}-cas-api> /dev/null \ - #|| true && echo "CAS API image stream in place" - - # Tag images + + oc create imagestream ${{ env.REPO_NAME }}-frontend> /dev/null || true && echo "Frontend image stream in place" + #oc create imagestream ${{ env.REPO_NAME }}-api> /dev/null || true && echo "Ecas API image stream in place" + #oc create imagestream ${{ env.REPO_NAME }}-cas-api> /dev/null || true && echo "CAS API image stream in place" + + oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-frontend.outputs.registry-path }} ${{ env.REPO_NAME }}-frontend:${{ env.TAG }} + + #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-api.outputs.registry-path }} ${{env.REPO_NAME }}-api:${{ env.TAG }} + + + #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} - # Update configmap - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }}\ - # Process and apply deployment template + + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} + + + + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/override-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV}} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} + + + + + # Process and apply deployment template + oc process -f ./openshift/templates/ecas-frontend/frontend.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE}}\ | oc apply -f - - #oc process -f ./openshift/templates/ecas-api/api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }} -p ASPNETCORE_ENVIRONMENT=${{ env.ASPNETCORE_ENVIRONMENT }}\ - #| oc apply -f - - #oc process -f ./openshift/templates/cas-api/cas-api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }}\ - #| oc apply -f - - - # Start rollout (if necessary) and follow it - oc rollout latest dc/${{ env.APP_NAME_FRONTEND }} 2> /dev/null \ - - || true && echo "Rollout Front End in progress" - #oc rollout latest dc/${{ env.APP_NAME_API }} 2> /dev/null \ - #|| true && echo "Rollout ECAS API in progress" - #oc rollout latest dc/${{ env.APP_NAME_CAS }} 2> /dev/null \ - - #|| true && echo "Rollout CAS API in progress" - - oc logs dc/${{ env.APP_NAME_FRONTEND }} \ + #oc process -f ./openshift/templates/ecas-api/api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }} -p ASPNETCORE_ENVIRONMENT=${{ env.ASPNETCORE_ENVIRONMENT }}\ + #| oc apply -f - - #oc logs dc/${{ env.APP_NAME_API }} - #oc logs dc/${{ env.APP_NAME_CAS }} - - # Get status, returns 0 if rollout is successful - - oc rollout status dc/${{ env.APP_NAME_FRONTEND }} \ - - #oc rollout status dc/${{ env.APP_NAME_API }} + #oc process -f ./openshift/templates/cas-api/cas-api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }}\ + #| oc apply -f - - #oc rollout status dc/${{ env.APP_NAME_CAS }} - name: ZAP Scan uses: zaproxy/action-full-scan@v0.7.0 From 185da446529220422fb9efa11fd13395f23db79c Mon Sep 17 00:00:00 2001 From: cditcher Date: Fri, 22 Nov 2024 11:29:42 -0800 Subject: [PATCH 30/94] Forgot to remove configmap --- .../workflows/build.from.master.branch.deploy.to.dev.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index e41122fae..fc0a90fb4 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -230,13 +230,7 @@ jobs: curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} - - - - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/override-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV}} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} - - - + # Process and apply deployment template From e780c5d2df3e762cb0bf3e4f4df10bae90d62e60 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 13:10:45 -0800 Subject: [PATCH 31/94] Rename update-configmap.sh to update-configmap-dev.sh --- openshift/{update-configmap.sh => update-configmap-dev.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename openshift/{update-configmap.sh => update-configmap-dev.sh} (100%) diff --git a/openshift/update-configmap.sh b/openshift/update-configmap-dev.sh similarity index 100% rename from openshift/update-configmap.sh rename to openshift/update-configmap-dev.sh From 4e8475fa831050795d15a49479b0706e77e91387 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 13:11:32 -0800 Subject: [PATCH 32/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index fc0a90fb4..5cb302e7b 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -229,7 +229,7 @@ jobs: - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap-dev.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} # Process and apply deployment template From 8997a0db2c33e8e0f7fba85d4d2b7555b9a10918 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 13:18:31 -0800 Subject: [PATCH 33/94] Rename update-configmap-dev.sh to update-configmap.sh --- openshift/{update-configmap-dev.sh => update-configmap.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename openshift/{update-configmap-dev.sh => update-configmap.sh} (100%) diff --git a/openshift/update-configmap-dev.sh b/openshift/update-configmap.sh similarity index 100% rename from openshift/update-configmap-dev.sh rename to openshift/update-configmap.sh From 56df3afa1f225e4764b4be0f6d3e50b9ab3747f3 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 13:39:56 -0800 Subject: [PATCH 34/94] Update build.from.master.branch.deploy.to.dev.yml --- ...build.from.master.branch.deploy.to.dev.yml | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 5cb302e7b..e757173d4 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -6,7 +6,7 @@ env: REDHAT_REGISTRY_USERNAME: '${{ secrets.REDHAT_REGISTRY_USERNAME }}' REDHAT_REGISTRY_PASSWORD: '${{ secrets.REDHAT_REGISTRY_PASSWORD }}' - ASPNETCORE_ENVIRONMENT: 'Development' + SOURCE_REPOSITORY: 'https://github.com/bcgov/EDUC-HUB.git' DOTNET_STARTUP_PROJECT: 'CASInterfaceService/cas-interface-service.csproj' @@ -30,9 +30,25 @@ env: MAX_CPU: 600m MIN_MEM: 250Mi MAX_MEM: 500Mi + + #frontend config maps vars APP_DEBUG: false DYNAMICSBASEURL: http://ecas-api:8080/api DOCUMENTROOT: /public + #ecas api config maps vars + ASPNETCORE_ENVIRONMENT: 'Development' + DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT: Cloud + DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL: https://ecasdev.api.crm3.dynamics.com/api/data/v9.2/ + DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL: https://localhost + DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL: https://ecasdev.crm3.dynamics.com/api/data/ + DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL: https://ecasdev.api.crm3.dynamics.com + + #cas api config maps vars + ASPNETCORE_ENVIRONMENT_CAS: 'Production' + CAS_API_SERVER: https://cfs-systws.cas.gov.bc.ca:7026 + CAS_TOKEN_URI: /ords/cas/oauth/token + CAS_INVOICE_URI: /ords/cas/cfs/apinvoice/ + HOST_ROUTE: '${{ secrets.SITE_URL }}' BRANCH: "Github_action_fixes" @@ -229,7 +245,7 @@ jobs: - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap-dev.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} ${{ASPNETCORE_ENVIRONMENT}} ${{DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL}} ${{ASPNETCORE_ENVIRONMENT_CAS}} ${{CAS_API_SERVER}} ${{CAS_TOKEN_URI}} ${{CAS_INVOICE_URI}} # Process and apply deployment template From 0bea54c19449143d7570a6f013299de82abdd9ce Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 13:43:29 -0800 Subject: [PATCH 35/94] Update build.from.master.branch.deploy.to.dev.yml --- ...build.from.master.branch.deploy.to.dev.yml | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index e757173d4..e1b29eda6 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -135,7 +135,6 @@ jobs: run: git clone '${{ env.SOURCE_REPOSITORY }}' - name: Setup and Build cas api - if: false id: build-image-cas uses: redhat-actions/s2i-build@v2 with: @@ -147,7 +146,6 @@ jobs: DOTNET_STARTUP_PROJECT=${{env.DOTNET_STARTUP_PROJECT}} - name: Setup and Build ecas api - if: false id: build-image-api uses: redhat-actions/s2i-build@v2 with: @@ -157,6 +155,7 @@ jobs: tags: ${{ env.TAG }} - name: Setup and Build Frontend + if: false id: build-image-frontend uses: redhat-actions/s2i-build@v2 with: @@ -175,6 +174,7 @@ jobs: run: docker images - name: Push frontend to registry + if: false id: push-image-frontend uses: redhat-actions/push-to-registry@v2 with: @@ -185,7 +185,6 @@ jobs: password: ${{ env.IMAGE_REGISTRY_PASSWORD }} - name: Push api to registry - if: false id: push-image-api uses: redhat-actions/push-to-registry@v2 with: @@ -196,7 +195,6 @@ jobs: password: ${{ env.IMAGE_REGISTRY_PASSWORD }} - name: Push cas to registry - if: false id: push-image-cas uses: redhat-actions/push-to-registry@v2 with: @@ -220,28 +218,28 @@ jobs: # Cancel any rollouts in progress - oc rollout cancel dc/${{ env.APP_NAME_FRONTEND }} 2> /dev/null || true && echo "No rollout in progress" + #oc rollout cancel dc/${{ env.APP_NAME_FRONTEND }} 2> /dev/null || true && echo "No rollout in progress" - #oc rollout cancel dc/${{ env.APP_NAME_API }} 2> /dev/null || true && echo "No ecas api rollout in progress" + oc rollout cancel dc/${{ env.APP_NAME_API }} 2> /dev/null || true && echo "No ecas api rollout in progress" - #oc rollout cancel dc/${{ env.APP_NAME_CAS }} 2> /dev/null || true && echo "No cas api rollout in progress" + oc rollout cancel dc/${{ env.APP_NAME_CAS }} 2> /dev/null || true && echo "No cas api rollout in progress" # Create the image stream if it doesn't exist - oc create imagestream ${{ env.REPO_NAME }}-frontend> /dev/null || true && echo "Frontend image stream in place" - #oc create imagestream ${{ env.REPO_NAME }}-api> /dev/null || true && echo "Ecas API image stream in place" - #oc create imagestream ${{ env.REPO_NAME }}-cas-api> /dev/null || true && echo "CAS API image stream in place" + #oc create imagestream ${{ env.REPO_NAME }}-frontend> /dev/null || true && echo "Frontend image stream in place" + oc create imagestream ${{ env.REPO_NAME }}-api> /dev/null || true && echo "Ecas API image stream in place" + oc create imagestream ${{ env.REPO_NAME }}-cas-api> /dev/null || true && echo "CAS API image stream in place" - oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-frontend.outputs.registry-path }} ${{ env.REPO_NAME }}-frontend:${{ env.TAG }} + #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-frontend.outputs.registry-path }} ${{ env.REPO_NAME }}-frontend:${{ env.TAG }} - #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-api.outputs.registry-path }} ${{env.REPO_NAME }}-api:${{ env.TAG }} + oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-api.outputs.registry-path }} ${{env.REPO_NAME }}-api:${{ env.TAG }} - #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} + oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} @@ -250,17 +248,17 @@ jobs: # Process and apply deployment template - oc process -f ./openshift/templates/ecas-frontend/frontend.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE}}\ - | oc apply -f - + #oc process -f ./openshift/templates/ecas-frontend/frontend.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE}}\ + #| oc apply -f - - #oc process -f ./openshift/templates/ecas-api/api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }} -p ASPNETCORE_ENVIRONMENT=${{ env.ASPNETCORE_ENVIRONMENT }}\ - #| oc apply -f - + oc process -f ./openshift/templates/ecas-api/api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }} -p ASPNETCORE_ENVIRONMENT=${{ env.ASPNETCORE_ENVIRONMENT }}\ + | oc apply -f - - #oc process -f ./openshift/templates/cas-api/cas-api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }}\ - #| oc apply -f - + oc process -f ./openshift/templates/cas-api/cas-api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }}\ + | oc apply -f - - name: ZAP Scan From 795b30f05b22686977641458834bc4b632348d68 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 14:02:32 -0800 Subject: [PATCH 36/94] Update update-configmap.sh --- openshift/update-configmap.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/openshift/update-configmap.sh b/openshift/update-configmap.sh index d6aaf069c..b830875c0 100644 --- a/openshift/update-configmap.sh +++ b/openshift/update-configmap.sh @@ -7,6 +7,18 @@ APP_DEBUG=$3 DOCUMENTROOT=$4 DYNAMICSBASEURL=$5 +ASPNETCORE_ENVIRONMENT=$6 +DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT=$7 +DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL=$8 +DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL=$9 +DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL=$10 +DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL=$11 + +ASPNETCORE_ENVIRONMENT_CAS=$12 +CAS_API_SERVER=$13 +CAS_TOKEN_URI=$14 +CAS_INVOICE_URI=$15 + ########################################################### #Setup for config-maps ########################################################### @@ -15,6 +27,16 @@ oc create -n "$NAMESPACE" configmap "$APP_NAME"-config-map \ --from-literal=APP_DEBUG="$APP_DEBUG" \ --from-literal=DOCUMENTROOT="$DOCUMENTROOT" \ --from-literal=DYNAMICSBASEURL="$DYNAMICSBASEURL" \ + --from-literal=ASPNETCORE_ENVIRONMENT="$ASPNETCORE_ENVIRONMENT" \ + --from-literal=DynamicsAuthenticationSettings__ActiveEnvironment="$DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT" \ + --from-literal=DynamicsAuthenticationSettings__CloudWebApiUrl="$DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL" \ + --from-literal=DynamicsAuthenticationSettings__CloudRedirectUrl="$DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL" \ + --from-literal=DynamicsAuthenticationSettings__CloudResourceUrl="$DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL" \ + --from-literal=DynamicsAuthenticationSettings__CloudBaseUrl="$DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL" \ + --from-literal=ASPNETCORE_ENVIRONMENT_CAS="$ASPNETCORE_ENVIRONMENT_CAS" \ + --from-literal=CAS_API_SERVER="$CAS_API_SERVER" \ + --from-literal=CAS_TOKEN_URI="$CAS_TOKEN_URI" \ + --from-literal=CAS_INVOICE_URI="$CAS_INVOICE_URI" \ --dry-run=client -o yaml | oc apply -f - echo Creating config map "$APP_NAME"-flb-sc-config-map From 3002437bf0ddf2ad572b68cdc0824df36c222564 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 14:09:56 -0800 Subject: [PATCH 37/94] Update api.dc.yaml --- openshift/templates/ecas-api/api.dc.yaml | 30 +++++++++++++++++++----- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/openshift/templates/ecas-api/api.dc.yaml b/openshift/templates/ecas-api/api.dc.yaml index 7407535d8..50d020353 100644 --- a/openshift/templates/ecas-api/api.dc.yaml +++ b/openshift/templates/ecas-api/api.dc.yaml @@ -39,11 +39,20 @@ name: "${APP_NAME}-api" env: - name: ASPNETCORE_ENVIRONMENT - value: ${ASPNETCORE_ENVIRONMENT} + valueFrom: + configMapKeyRef: + name: ${REPO_NAME}-config-map + key: ASPNETCORE_ENVIRONMENT - name: DynamicsAuthenticationSettings__ActiveEnvironment - value: ${DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT} + valueFrom: + configMapKeyRef: + name: ${REPO_NAME}-config-map + key: DynamicsAuthenticationSettings__ActiveEnvironment - name: DynamicsAuthenticationSettings__CloudWebApiUrl - value: ${DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL} + valueFrom: + configMapKeyRef: + name: ${REPO_NAME}-config-map + key: DynamicsAuthenticationSettings__CloudWebApiUrl - name: ECasAPISecuritySettings__UserName valueFrom: secretKeyRef: @@ -55,9 +64,15 @@ name: ecas-api-credentials key: password - name: DynamicsAuthenticationSettings__CloudRedirectUrl - value: ${DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL} + valueFrom: + configMapKeyRef: + name: ${REPO_NAME}-config-map + key: DynamicsAuthenticationSettings__CloudRedirectUrl - name: DynamicsAuthenticationSettings__CloudResourceUrl - value: ${DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL} + valueFrom: + configMapKeyRef: + name: ${REPO_NAME}-config-map + key: DynamicsAuthenticationSettings__CloudResourceUrl - name: DynamicsAuthenticationSettings__CloudClientId valueFrom: secretKeyRef: @@ -79,7 +94,10 @@ name: ecas-api-credentials key: TenantId - name: DynamicsAuthenticationSettings__CloudBaseUrl - value: ${DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL} + valueFrom: + configMapKeyRef: + name: ${REPO_NAME}-config-map + key: DynamicsAuthenticationSettings__CloudBaseUrl From 8204e14cbab26c82c673d3cddb77c91f091de4f9 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 14:12:59 -0800 Subject: [PATCH 38/94] Update cas-api.dc.yaml --- openshift/templates/cas-api/cas-api.dc.yaml | 35 +++++++++------------ 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/openshift/templates/cas-api/cas-api.dc.yaml b/openshift/templates/cas-api/cas-api.dc.yaml index 29a4c41b2..7d352b337 100644 --- a/openshift/templates/cas-api/cas-api.dc.yaml +++ b/openshift/templates/cas-api/cas-api.dc.yaml @@ -39,13 +39,23 @@ name: "cas-api" env: - name: ASPNETCORE_ENVIRONMENT - value: ${ASPNETCORE_ENVIRONMENT} + valueFrom: + configMapKeyRef: + name: ${REPO_NAME}-config-map + key: ASPNETCORE_ENVIRONMENT_CAS - name: CAS_API_SERVER - value: ${CAS_API_SERVER} + valueFrom: + configMapKeyRef: + name: ${REPO_NAME}-config-map + key: CAS_API_SERVER - name: CAS_TOKEN_URI - value: ${CAS_TOKEN_URI} + configMapKeyRef: + name: ${REPO_NAME}-config-map + key: CAS_TOKEN_URI - name: CAS_INVOICE_URI - value: ${CAS_INVOICE_URI} + configMapKeyRef: + name: ${REPO_NAME}-config-map + key: CAS_INVOICE_URI @@ -156,22 +166,7 @@ description: The maximum amount of memory required: true - - name: ASPNETCORE_ENVIRONMENT - displayName: ASPNETCORE_ENVIRONMENT - required: true - value: "Production" - - name: CAS_API_SERVER - displayName: CAS_API_SERVER - required: true - value: "https://cfs-systws.cas.gov.bc.ca:7026" - - name: CAS_TOKEN_URI - displayName: CAS_TOKEN_URI - required: true - value: "/ords/cas/oauth/token" - - name: CAS_INVOICE_URI - displayName: CAS_INVOICE_URI - required: true - value: "/ords/cas/cfs/apinvoice/" + From e534a17a6dd91873f3b586c6367ac9f9db8edba3 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 14:13:24 -0800 Subject: [PATCH 39/94] Update api.dc.yaml --- openshift/templates/ecas-api/api.dc.yaml | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/openshift/templates/ecas-api/api.dc.yaml b/openshift/templates/ecas-api/api.dc.yaml index 50d020353..1f7da75a5 100644 --- a/openshift/templates/ecas-api/api.dc.yaml +++ b/openshift/templates/ecas-api/api.dc.yaml @@ -207,28 +207,6 @@ - name: MAX_MEM description: The maximum amount of memory required: true - - name: ASPNETCORE_ENVIRONMENT - displayName: ASPNETCORE_ENVIRONMENT - required: true - - name: DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT - displayName: DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT - required: true - value: Cloud - - name: DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL - displayName: DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL - required: true - value: https://ecasdev.api.crm3.dynamics.com/api/data/v9.2/ - - name: DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL - displayName: DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL - required: true - value: https://localhost - - name: DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL - displayName: DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL - required: true - value: https://ecasdev.crm3.dynamics.com/api/data/ - - name: DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL - displayName: DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL - required: true - value: https://ecasdev.api.crm3.dynamics.com + From 16afc30580d03e7089e5e12d31ce09d94556962b Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 14:15:51 -0800 Subject: [PATCH 40/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index e1b29eda6..9a52850fd 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -253,7 +253,7 @@ jobs: - oc process -f ./openshift/templates/ecas-api/api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }} -p ASPNETCORE_ENVIRONMENT=${{ env.ASPNETCORE_ENVIRONMENT }}\ + oc process -f ./openshift/templates/ecas-api/api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }}\ | oc apply -f - From 859f86e0a7f63c22b0918254bea0962fce89c72d Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 14:19:16 -0800 Subject: [PATCH 41/94] Update api.dc.yaml --- openshift/templates/ecas-api/api.dc.yaml | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/openshift/templates/ecas-api/api.dc.yaml b/openshift/templates/ecas-api/api.dc.yaml index 1f7da75a5..3c20e8399 100644 --- a/openshift/templates/ecas-api/api.dc.yaml +++ b/openshift/templates/ecas-api/api.dc.yaml @@ -131,6 +131,27 @@ test: false triggers: - type: ConfigChange + + - apiVersion: v1 + kind: Route + metadata: + name: "${APP_NAME}-api" + labels: + name: "${APP_NAME}-api" + app: ${APP_NAME} + app-group: ${APP_NAME} + spec: + host: ${APPLICATION_DOMAIN} + port: + targetPort: "${APP_NAME}-api" + tls: + insecureEdgeTerminationPolicy: Redirect + termination: edge + to: + kind: Service + name: "${APP_NAME}-api" + weight: 100 + - apiVersion: v1 kind: Service metadata: @@ -207,6 +228,11 @@ - name: MAX_MEM description: The maximum amount of memory required: true + - name: APPLICATION_DOMAIN + displayName: Application Hostname + description: The exposed hostname that will route to the service, if left blank a value will be defaulted. + required: false + value: "" From c65566298099195410b0000bf9c457059f3a2f28 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 14:32:03 -0800 Subject: [PATCH 42/94] Update cas-api.dc.yaml --- openshift/templates/cas-api/cas-api.dc.yaml | 57 +++++++++++++-------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/openshift/templates/cas-api/cas-api.dc.yaml b/openshift/templates/cas-api/cas-api.dc.yaml index 7d352b337..18cd7090b 100644 --- a/openshift/templates/cas-api/cas-api.dc.yaml +++ b/openshift/templates/cas-api/cas-api.dc.yaml @@ -4,15 +4,15 @@ metadata: name: "cas-api-dc" - creationTimestamp: objects: - apiVersion: v1 kind: DeploymentConfig metadata: - - creationTimestamp: labels: app: "${APP_NAME}" + name: "cas-api" + app-group: "${APP_NAME}" + template: "educ-${APP_NAME}-template" name: "cas-api" spec: replicas: ${{MIN_REPLICAS}} @@ -24,8 +24,6 @@ type: Rolling template: metadata: - - creationTimestamp: labels: app: "${APP_NAME}" deploymentconfig: "cas-api" @@ -33,9 +31,6 @@ containers: - image: image-registry.openshift-image-registry.svc:5000/${NAMESPACE}/${REPO_NAME}-cas-api:${TAG} imagePullPolicy: Always - - - name: "cas-api" env: - name: ASPNETCORE_ENVIRONMENT @@ -56,9 +51,6 @@ configMapKeyRef: name: ${REPO_NAME}-config-map key: CAS_INVOICE_URI - - - ports: - containerPort: 8080 protocol: TCP @@ -75,9 +67,7 @@ httpGet: path: "/" port: 8080 - scheme: HTTP - - + scheme: HTTP resources: requests: cpu: "${MIN_CPU}" @@ -89,12 +79,34 @@ test: false triggers: - type: ConfigChange + - apiVersion: v1 + kind: Route + metadata: + name: "cas-api" + labels: + name: "cas-api" + app: ${APP_NAME} + app-group: ${APP_NAME} + spec: + host: ${APPLICATION_DOMAIN} + port: + targetPort: "cas-api" + tls: + insecureEdgeTerminationPolicy: Redirect + termination: edge + to: + kind: Service + name: "cas-api" + weight: 100 + - apiVersion: v1 kind: Service metadata: - labels: app: "${APP_NAME}" + name: "cas-api" + app-group: "${APP_NAME}" + template: "educ-${APP_NAME}-template" name: "cas-api" spec: ports: @@ -106,15 +118,15 @@ app: "${APP_NAME}" deploymentconfig: "cas-api" - - - - - - apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: "cas-api-cpu-autoscaler" + labels: + template: "educ-${APP_NAME}-template" + app: "${APP_NAME}" + name: "cas-api" + app-group: "${APP_NAME}" spec: scaleTargetRef: apiVersion: apps.openshift.io/v1 @@ -165,6 +177,11 @@ - name: MAX_MEM description: The maximum amount of memory required: true + - name: APPLICATION_DOMAIN + displayName: Application Hostname + description: The exposed hostname that will route to the service, if left blank a value will be defaulted. + required: false + value: "" From 14ba015a845e806c73952af3d336b942146c0fa4 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 14:38:34 -0800 Subject: [PATCH 43/94] Update api.dc.yaml --- openshift/templates/ecas-api/api.dc.yaml | 29 +++++++++--------------- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/openshift/templates/ecas-api/api.dc.yaml b/openshift/templates/ecas-api/api.dc.yaml index 3c20e8399..2f85cebaf 100644 --- a/openshift/templates/ecas-api/api.dc.yaml +++ b/openshift/templates/ecas-api/api.dc.yaml @@ -9,10 +9,11 @@ - apiVersion: v1 kind: DeploymentConfig metadata: - - creationTimestamp: labels: app: "${APP_NAME}" + name: "${APP_NAME}-api" + app-group: "${APP_NAME}" + template: "educ-${APP_NAME}-template" name: "${APP_NAME}-api" spec: replicas: ${{MIN_REPLICAS}} @@ -24,8 +25,6 @@ type: Rolling template: metadata: - - creationTimestamp: labels: app: "${APP_NAME}" deploymentconfig: "${APP_NAME}-api" @@ -33,9 +32,6 @@ containers: - image: image-registry.openshift-image-registry.svc:5000/${NAMESPACE}/${REPO_NAME}-api:${TAG} imagePullPolicy: Always - - - name: "${APP_NAME}-api" env: - name: ASPNETCORE_ENVIRONMENT @@ -98,9 +94,6 @@ configMapKeyRef: name: ${REPO_NAME}-config-map key: DynamicsAuthenticationSettings__CloudBaseUrl - - - ports: - containerPort: 8080 protocol: TCP @@ -118,8 +111,6 @@ path: "/api/environmentinformation" port: 8080 scheme: HTTP - - resources: requests: cpu: "${MIN_CPU}" @@ -155,9 +146,11 @@ - apiVersion: v1 kind: Service metadata: - labels: app: "${APP_NAME}" + name: "${APP_NAME}-api" + app-group: "${APP_NAME}" + template: "educ-${APP_NAME}-template" name: "${APP_NAME}-api" spec: ports: @@ -169,15 +162,15 @@ app: "${APP_NAME}" deploymentconfig: "${APP_NAME}-api" - - - - - - apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: "${APP_NAME}-api-cpu-autoscaler" + labels: + template: "educ-${APP_NAME}-template" + app: "${APP_NAME}" + name: "${APP_NAME}-api" + app-group: "${APP_NAME}" spec: scaleTargetRef: apiVersion: apps.openshift.io/v1 From d1b6b4e62a79471fe4d87d9d73353c4526a3a126 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 14:57:00 -0800 Subject: [PATCH 44/94] Update cas-api.dc.yaml --- openshift/templates/cas-api/cas-api.dc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openshift/templates/cas-api/cas-api.dc.yaml b/openshift/templates/cas-api/cas-api.dc.yaml index 18cd7090b..b5019fbbe 100644 --- a/openshift/templates/cas-api/cas-api.dc.yaml +++ b/openshift/templates/cas-api/cas-api.dc.yaml @@ -90,7 +90,7 @@ spec: host: ${APPLICATION_DOMAIN} port: - targetPort: "cas-api" + targetPort: "8080-tcp" tls: insecureEdgeTerminationPolicy: Redirect termination: edge From b542cc39fd3a764f68d2d62d92804f744c30e083 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:05:51 -0800 Subject: [PATCH 45/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 9a52850fd..d4176fc1f 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -32,10 +32,13 @@ env: MAX_MEM: 500Mi #frontend config maps vars + APP_DEBUG: false DYNAMICSBASEURL: http://ecas-api:8080/api DOCUMENTROOT: /public + #ecas api config maps vars + ASPNETCORE_ENVIRONMENT: 'Development' DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT: Cloud DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL: https://ecasdev.api.crm3.dynamics.com/api/data/v9.2/ @@ -44,6 +47,7 @@ env: DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL: https://ecasdev.api.crm3.dynamics.com #cas api config maps vars + ASPNETCORE_ENVIRONMENT_CAS: 'Production' CAS_API_SERVER: https://cfs-systws.cas.gov.bc.ca:7026 CAS_TOKEN_URI: /ords/cas/oauth/token From 9beea6c166d2c93058438b71136ea953281408d0 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:08:48 -0800 Subject: [PATCH 46/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index d4176fc1f..e1cb5cb5e 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -39,7 +39,7 @@ env: #ecas api config maps vars - ASPNETCORE_ENVIRONMENT: 'Development' + ASPNETCORE_ENVIRONMENT: Development DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT: Cloud DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL: https://ecasdev.api.crm3.dynamics.com/api/data/v9.2/ DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL: https://localhost @@ -48,7 +48,7 @@ env: #cas api config maps vars - ASPNETCORE_ENVIRONMENT_CAS: 'Production' + ASPNETCORE_ENVIRONMENT_CAS: Production CAS_API_SERVER: https://cfs-systws.cas.gov.bc.ca:7026 CAS_TOKEN_URI: /ords/cas/oauth/token CAS_INVOICE_URI: /ords/cas/cfs/apinvoice/ From d43df7590476f9fa39c90fc07f9036288a618240 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:27:21 -0800 Subject: [PATCH 47/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index e1cb5cb5e..df97bdffc 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -247,7 +247,7 @@ jobs: - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} ${{ASPNETCORE_ENVIRONMENT}} ${{DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL}} ${{ASPNETCORE_ENVIRONMENT_CAS}} ${{CAS_API_SERVER}} ${{CAS_TOKEN_URI}} ${{CAS_INVOICE_URI}} + #curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} ${{ASPNETCORE_ENVIRONMENT}} ${{DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL}} ${{ASPNETCORE_ENVIRONMENT_CAS}} ${{CAS_API_SERVER}} ${{CAS_TOKEN_URI}} ${{CAS_INVOICE_URI}} # Process and apply deployment template From 362775ae51d607d8f2ab389b9b77bf6d28ad6692 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:30:43 -0800 Subject: [PATCH 48/94] Update build.from.master.branch.deploy.to.dev.yml --- .../workflows/build.from.master.branch.deploy.to.dev.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index df97bdffc..bfc297c69 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -30,24 +30,16 @@ env: MAX_CPU: 600m MIN_MEM: 250Mi MAX_MEM: 500Mi - - #frontend config maps vars APP_DEBUG: false DYNAMICSBASEURL: http://ecas-api:8080/api DOCUMENTROOT: /public - - #ecas api config maps vars - ASPNETCORE_ENVIRONMENT: Development DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT: Cloud DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL: https://ecasdev.api.crm3.dynamics.com/api/data/v9.2/ DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL: https://localhost DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL: https://ecasdev.crm3.dynamics.com/api/data/ DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL: https://ecasdev.api.crm3.dynamics.com - - #cas api config maps vars - ASPNETCORE_ENVIRONMENT_CAS: Production CAS_API_SERVER: https://cfs-systws.cas.gov.bc.ca:7026 CAS_TOKEN_URI: /ords/cas/oauth/token From 20f5f8d43ba8dffd96b921273cb4bc8508d489dd Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:31:52 -0800 Subject: [PATCH 49/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index bfc297c69..c2068a339 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -40,7 +40,7 @@ env: DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL: https://localhost DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL: https://ecasdev.crm3.dynamics.com/api/data/ DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL: https://ecasdev.api.crm3.dynamics.com - ASPNETCORE_ENVIRONMENT_CAS: Production + CAS_API_SERVER: https://cfs-systws.cas.gov.bc.ca:7026 CAS_TOKEN_URI: /ords/cas/oauth/token CAS_INVOICE_URI: /ords/cas/cfs/apinvoice/ From 60e087d57c68e57e05d56fc1cf81f853a5fefda7 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:33:41 -0800 Subject: [PATCH 50/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index c2068a339..571e90c47 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -34,12 +34,13 @@ env: APP_DEBUG: false DYNAMICSBASEURL: http://ecas-api:8080/api DOCUMENTROOT: /public - ASPNETCORE_ENVIRONMENT: Development + #ASPNETCORE_ENVIRONMENT: Development DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT: Cloud DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL: https://ecasdev.api.crm3.dynamics.com/api/data/v9.2/ DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL: https://localhost DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL: https://ecasdev.crm3.dynamics.com/api/data/ DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL: https://ecasdev.api.crm3.dynamics.com + ASPNETCORE_ENVIRONMENT_CAS: Production CAS_API_SERVER: https://cfs-systws.cas.gov.bc.ca:7026 CAS_TOKEN_URI: /ords/cas/oauth/token @@ -239,7 +240,7 @@ jobs: - #curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} ${{ASPNETCORE_ENVIRONMENT}} ${{DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL}} ${{ASPNETCORE_ENVIRONMENT_CAS}} ${{CAS_API_SERVER}} ${{CAS_TOKEN_URI}} ${{CAS_INVOICE_URI}} + #curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} ${{ASPNETCORE_ENVIRONMENT}} ${{DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL}} ${{ASPNETCORE_ENVIRONMENT_CAS}} ${{CAS_API_SERVER}} ${{CAS_TOKEN_URI}} ${{CAS_INVOICE_URI}} # Process and apply deployment template From f32c6ef85e155deb3481fad83583e5ca7749302b Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:34:51 -0800 Subject: [PATCH 51/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 571e90c47..7016345b3 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -34,7 +34,7 @@ env: APP_DEBUG: false DYNAMICSBASEURL: http://ecas-api:8080/api DOCUMENTROOT: /public - #ASPNETCORE_ENVIRONMENT: Development + ASPNETCORE_ENVIRONMENT: Development DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT: Cloud DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL: https://ecasdev.api.crm3.dynamics.com/api/data/v9.2/ DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL: https://localhost From 6a2a5edb94b5b187f9633ec58a78533fb66a32f7 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:39:59 -0800 Subject: [PATCH 52/94] Update build.from.master.branch.deploy.to.dev.yml --- .../build.from.master.branch.deploy.to.dev.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 7016345b3..6e321ced3 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -217,26 +217,26 @@ jobs: #oc rollout cancel dc/${{ env.APP_NAME_FRONTEND }} 2> /dev/null || true && echo "No rollout in progress" - oc rollout cancel dc/${{ env.APP_NAME_API }} 2> /dev/null || true && echo "No ecas api rollout in progress" + #oc rollout cancel dc/${{ env.APP_NAME_API }} 2> /dev/null || true && echo "No ecas api rollout in progress" - oc rollout cancel dc/${{ env.APP_NAME_CAS }} 2> /dev/null || true && echo "No cas api rollout in progress" + #oc rollout cancel dc/${{ env.APP_NAME_CAS }} 2> /dev/null || true && echo "No cas api rollout in progress" # Create the image stream if it doesn't exist #oc create imagestream ${{ env.REPO_NAME }}-frontend> /dev/null || true && echo "Frontend image stream in place" - oc create imagestream ${{ env.REPO_NAME }}-api> /dev/null || true && echo "Ecas API image stream in place" - oc create imagestream ${{ env.REPO_NAME }}-cas-api> /dev/null || true && echo "CAS API image stream in place" + #oc create imagestream ${{ env.REPO_NAME }}-api> /dev/null || true && echo "Ecas API image stream in place" + #oc create imagestream ${{ env.REPO_NAME }}-cas-api> /dev/null || true && echo "CAS API image stream in place" #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-frontend.outputs.registry-path }} ${{ env.REPO_NAME }}-frontend:${{ env.TAG }} - oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-api.outputs.registry-path }} ${{env.REPO_NAME }}-api:${{ env.TAG }} + #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-api.outputs.registry-path }} ${{env.REPO_NAME }}-api:${{ env.TAG }} - oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} + #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} From 8a932d05ed24a6d8434ec5401b97c1d26390b5cd Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:41:37 -0800 Subject: [PATCH 53/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 6e321ced3..ba97438b2 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -34,7 +34,7 @@ env: APP_DEBUG: false DYNAMICSBASEURL: http://ecas-api:8080/api DOCUMENTROOT: /public - ASPNETCORE_ENVIRONMENT: Development + DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT: Cloud DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL: https://ecasdev.api.crm3.dynamics.com/api/data/v9.2/ DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL: https://localhost @@ -240,7 +240,7 @@ jobs: - #curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} ${{ASPNETCORE_ENVIRONMENT}} ${{DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL}} ${{ASPNETCORE_ENVIRONMENT_CAS}} ${{CAS_API_SERVER}} ${{CAS_TOKEN_URI}} ${{CAS_INVOICE_URI}} + #curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} ${{DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL}} ${{ASPNETCORE_ENVIRONMENT_CAS}} ${{CAS_API_SERVER}} ${{CAS_TOKEN_URI}} ${{CAS_INVOICE_URI}} # Process and apply deployment template From 9fdaeae84b1a084375d5bfae3585ec2795793ff1 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:43:05 -0800 Subject: [PATCH 54/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index ba97438b2..cb1e5401a 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -240,7 +240,7 @@ jobs: - #curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} ${{DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL}} ${{ASPNETCORE_ENVIRONMENT_CAS}} ${{CAS_API_SERVER}} ${{CAS_TOKEN_URI}} ${{CAS_INVOICE_URI}} + #curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL}} ${{ASPNETCORE_ENVIRONMENT_CAS}} ${{CAS_API_SERVER}} ${{CAS_TOKEN_URI}} ${{CAS_INVOICE_URI}} # Process and apply deployment template From 4807693d393d9d843622498cfdcd8b5bf10dee51 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:47:14 -0800 Subject: [PATCH 55/94] Update build.from.master.branch.deploy.to.dev.yml --- ...build.from.master.branch.deploy.to.dev.yml | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index cb1e5401a..67c1a68ec 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -30,18 +30,21 @@ env: MAX_CPU: 600m MIN_MEM: 250Mi MAX_MEM: 500Mi - + + #frontend config maps vars APP_DEBUG: false DYNAMICSBASEURL: http://ecas-api:8080/api DOCUMENTROOT: /public - + #ecas api config maps vars + ASPNETCORE_ENVIRONMENT: 'Development' DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT: Cloud DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL: https://ecasdev.api.crm3.dynamics.com/api/data/v9.2/ DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL: https://localhost DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL: https://ecasdev.crm3.dynamics.com/api/data/ DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL: https://ecasdev.api.crm3.dynamics.com - ASPNETCORE_ENVIRONMENT_CAS: Production - + + #cas api config maps vars + ASPNETCORE_ENVIRONMENT_CAS: 'Production' CAS_API_SERVER: https://cfs-systws.cas.gov.bc.ca:7026 CAS_TOKEN_URI: /ords/cas/oauth/token CAS_INVOICE_URI: /ords/cas/cfs/apinvoice/ @@ -217,30 +220,31 @@ jobs: #oc rollout cancel dc/${{ env.APP_NAME_FRONTEND }} 2> /dev/null || true && echo "No rollout in progress" - #oc rollout cancel dc/${{ env.APP_NAME_API }} 2> /dev/null || true && echo "No ecas api rollout in progress" + oc rollout cancel dc/${{ env.APP_NAME_API }} 2> /dev/null || true && echo "No ecas api rollout in progress" - #oc rollout cancel dc/${{ env.APP_NAME_CAS }} 2> /dev/null || true && echo "No cas api rollout in progress" + oc rollout cancel dc/${{ env.APP_NAME_CAS }} 2> /dev/null || true && echo "No cas api rollout in progress" # Create the image stream if it doesn't exist #oc create imagestream ${{ env.REPO_NAME }}-frontend> /dev/null || true && echo "Frontend image stream in place" - #oc create imagestream ${{ env.REPO_NAME }}-api> /dev/null || true && echo "Ecas API image stream in place" - #oc create imagestream ${{ env.REPO_NAME }}-cas-api> /dev/null || true && echo "CAS API image stream in place" + oc create imagestream ${{ env.REPO_NAME }}-api> /dev/null || true && echo "Ecas API image stream in place" + oc create imagestream ${{ env.REPO_NAME }}-cas-api> /dev/null || true && echo "CAS API image stream in place" #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-frontend.outputs.registry-path }} ${{ env.REPO_NAME }}-frontend:${{ env.TAG }} - #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-api.outputs.registry-path }} ${{env.REPO_NAME }}-api:${{ env.TAG }} + oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-api.outputs.registry-path }} ${{env.REPO_NAME }}-api:${{ env.TAG }} + + oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} - #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} ${{ASPNETCORE_ENVIRONMENT}} ${{DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL}} ${{ASPNETCORE_ENVIRONMENT_CAS}} ${{CAS_API_SERVER}} ${{CAS_TOKEN_URI}} ${{CAS_INVOICE_URI}} - #curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL}} ${{ASPNETCORE_ENVIRONMENT_CAS}} ${{CAS_API_SERVER}} ${{CAS_TOKEN_URI}} ${{CAS_INVOICE_URI}} # Process and apply deployment template From b86685e1b1deffaacbc78fa5b1e27861119cd088 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:49:29 -0800 Subject: [PATCH 56/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 67c1a68ec..a9d561573 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -243,7 +243,7 @@ jobs: - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ env.APP_DEBUG }} ${{ env.DOCUMENTROOT }} ${{ env.DYNAMICSBASEURL }} ${{ASPNETCORE_ENVIRONMENT}} ${{DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL}} ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL}} ${{ASPNETCORE_ENVIRONMENT_CAS}} ${{CAS_API_SERVER}} ${{CAS_TOKEN_URI}} ${{CAS_INVOICE_URI}} + From 311f8ef0377d849b68530cf5b87b51a29f6a8019 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:52:30 -0800 Subject: [PATCH 57/94] Update build.from.master.branch.deploy.to.dev.yml --- .../build.from.master.branch.deploy.to.dev.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index a9d561573..26fcb91dc 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -240,6 +240,18 @@ jobs: oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} + + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} \ + ${{ env.OPENSHIFT_NAMESPACE_DEV }} \ + ${{ env.APP_DEBUG}} ${{ env.DOCUMENTROOT }} \ + ${{ env.DYNAMICSBASEURL}} \ + ${{ASPNETCORE_ENVIRONMENT}} ${{DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT}} \ + ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}} \ + ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL}} \ + ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL}}\ + ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL}} ${{ASPNETCORE_ENVIRONMENT_CAS}} \ + ${{CAS_API_SERVER}} ${{CAS_TOKEN_URI}} ${{CAS_INVOICE_URI}} + From 434cba621d5371275d1a6f57b872ae54fe89eb44 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:55:02 -0800 Subject: [PATCH 58/94] Update build.from.master.branch.deploy.to.dev.yml --- .../build.from.master.branch.deploy.to.dev.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 26fcb91dc..c276fb450 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -245,12 +245,12 @@ jobs: ${{ env.OPENSHIFT_NAMESPACE_DEV }} \ ${{ env.APP_DEBUG}} ${{ env.DOCUMENTROOT }} \ ${{ env.DYNAMICSBASEURL}} \ - ${{ASPNETCORE_ENVIRONMENT}} ${{DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT}} \ - ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}} \ - ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL}} \ - ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL}}\ - ${{DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL}} ${{ASPNETCORE_ENVIRONMENT_CAS}} \ - ${{CAS_API_SERVER}} ${{CAS_TOKEN_URI}} ${{CAS_INVOICE_URI}} + ${{env.ASPNETCORE_ENVIRONMENT}} ${{env.DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT}} \ + ${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}} \ + ${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL}} \ + ${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL}}\ + ${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL}} ${{env.ASPNETCORE_ENVIRONMENT_CAS}} \ + ${{env.CAS_API_SERVER}} ${{env.CAS_TOKEN_URI}} ${{env.CAS_INVOICE_URI}} From 52e9982f09e6d166d5d3cbd60156e40bcec87c56 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 21:43:24 -0800 Subject: [PATCH 59/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index c276fb450..6215e015f 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -218,7 +218,7 @@ jobs: # Cancel any rollouts in progress - #oc rollout cancel dc/${{ env.APP_NAME_FRONTEND }} 2> /dev/null || true && echo "No rollout in progress" + oc rollout cancel dc/${{ env.APP_NAME_FRONTEND }} 2> /dev/null || true && echo "No rollout in progress" oc rollout cancel dc/${{ env.APP_NAME_API }} 2> /dev/null || true && echo "No ecas api rollout in progress" From 5c392b714bd928f923c5fac18eb33c69968b6c17 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 21:48:31 -0800 Subject: [PATCH 60/94] Update update-configmap.sh --- openshift/update-configmap.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/openshift/update-configmap.sh b/openshift/update-configmap.sh index b830875c0..7c92f7ef4 100644 --- a/openshift/update-configmap.sh +++ b/openshift/update-configmap.sh @@ -23,6 +23,7 @@ CAS_INVOICE_URI=$15 #Setup for config-maps ########################################################### echo Creating config map "$APP_NAME"-config-map +echo "$NAMESPACE" oc create -n "$NAMESPACE" configmap "$APP_NAME"-config-map \ --from-literal=APP_DEBUG="$APP_DEBUG" \ --from-literal=DOCUMENTROOT="$DOCUMENTROOT" \ From b0334cd0e0bdb144c88dccc7c9a316ddadb18161 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 21:54:53 -0800 Subject: [PATCH 61/94] Update update-configmap.sh --- openshift/update-configmap.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openshift/update-configmap.sh b/openshift/update-configmap.sh index 7c92f7ef4..63569d95b 100644 --- a/openshift/update-configmap.sh +++ b/openshift/update-configmap.sh @@ -24,7 +24,7 @@ CAS_INVOICE_URI=$15 ########################################################### echo Creating config map "$APP_NAME"-config-map echo "$NAMESPACE" -oc create -n "$NAMESPACE" configmap "$APP_NAME"-config-map \ +oc create -n 7d321c-dev configmap ecas-config-map \ --from-literal=APP_DEBUG="$APP_DEBUG" \ --from-literal=DOCUMENTROOT="$DOCUMENTROOT" \ --from-literal=DYNAMICSBASEURL="$DYNAMICSBASEURL" \ @@ -41,7 +41,7 @@ oc create -n "$NAMESPACE" configmap "$APP_NAME"-config-map \ --dry-run=client -o yaml | oc apply -f - echo Creating config map "$APP_NAME"-flb-sc-config-map -oc create -n "$NAMESPACE" configmap "$APP_NAME"-flb-sc-config-map \ +oc create -n 7d321c-dev configmap ecas-flb-sc-config-map \ --from-literal=fluent-bit.conf="$FLB_CONFIG" \ --from-literal=parsers.conf="$PARSER_CONFIG" \ --dry-run=client -o yaml | oc apply -f - From 6022e67f9cf918b1ed747e6bedcb9baf08fb9afc Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 22:00:12 -0800 Subject: [PATCH 62/94] Update update-configmap.sh --- openshift/update-configmap.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openshift/update-configmap.sh b/openshift/update-configmap.sh index 63569d95b..da88a5eb2 100644 --- a/openshift/update-configmap.sh +++ b/openshift/update-configmap.sh @@ -24,7 +24,7 @@ CAS_INVOICE_URI=$15 ########################################################### echo Creating config map "$APP_NAME"-config-map echo "$NAMESPACE" -oc create -n 7d321c-dev configmap ecas-config-map \ +oc create configmap ecas-config-map \ --from-literal=APP_DEBUG="$APP_DEBUG" \ --from-literal=DOCUMENTROOT="$DOCUMENTROOT" \ --from-literal=DYNAMICSBASEURL="$DYNAMICSBASEURL" \ @@ -41,7 +41,7 @@ oc create -n 7d321c-dev configmap ecas-config-map \ --dry-run=client -o yaml | oc apply -f - echo Creating config map "$APP_NAME"-flb-sc-config-map -oc create -n 7d321c-dev configmap ecas-flb-sc-config-map \ +oc create configmap ecas-flb-sc-config-map \ --from-literal=fluent-bit.conf="$FLB_CONFIG" \ --from-literal=parsers.conf="$PARSER_CONFIG" \ --dry-run=client -o yaml | oc apply -f - From 89f257d511061917b106ffd72c0531d4912d7752 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 22:02:35 -0800 Subject: [PATCH 63/94] Update api.dc.yaml --- openshift/templates/ecas-api/api.dc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openshift/templates/ecas-api/api.dc.yaml b/openshift/templates/ecas-api/api.dc.yaml index 2f85cebaf..44f66317a 100644 --- a/openshift/templates/ecas-api/api.dc.yaml +++ b/openshift/templates/ecas-api/api.dc.yaml @@ -90,7 +90,7 @@ name: ecas-api-credentials key: TenantId - name: DynamicsAuthenticationSettings__CloudBaseUrl - valueFrom: + valueFrom: configMapKeyRef: name: ${REPO_NAME}-config-map key: DynamicsAuthenticationSettings__CloudBaseUrl From 7cfec217f4167c9c36c284302585a38476187bd5 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 22:11:24 -0800 Subject: [PATCH 64/94] Update api.dc.yaml --- openshift/templates/ecas-api/api.dc.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openshift/templates/ecas-api/api.dc.yaml b/openshift/templates/ecas-api/api.dc.yaml index 44f66317a..d033fa0a6 100644 --- a/openshift/templates/ecas-api/api.dc.yaml +++ b/openshift/templates/ecas-api/api.dc.yaml @@ -161,16 +161,15 @@ selector: app: "${APP_NAME}" deploymentconfig: "${APP_NAME}-api" - - apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: - name: "${APP_NAME}-api-cpu-autoscaler" - labels: + labels: template: "educ-${APP_NAME}-template" app: "${APP_NAME}" name: "${APP_NAME}-api" app-group: "${APP_NAME}" + name: "${APP_NAME}-api-cpu-autoscaler" spec: scaleTargetRef: apiVersion: apps.openshift.io/v1 @@ -186,6 +185,7 @@ target: type: Utilization averageUtilization: 90 + parameters: - name: REPO_NAME description: Application repository name From 5e2964b9ee8d759a0ae0af263ef8da0303361b56 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 22:18:40 -0800 Subject: [PATCH 65/94] Update cas-api.dc.yaml --- openshift/templates/cas-api/cas-api.dc.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openshift/templates/cas-api/cas-api.dc.yaml b/openshift/templates/cas-api/cas-api.dc.yaml index b5019fbbe..083f9bb7f 100644 --- a/openshift/templates/cas-api/cas-api.dc.yaml +++ b/openshift/templates/cas-api/cas-api.dc.yaml @@ -80,14 +80,14 @@ triggers: - type: ConfigChange - apiVersion: v1 - kind: Route - metadata: + kind: Route + metadata: name: "cas-api" labels: name: "cas-api" app: ${APP_NAME} app-group: ${APP_NAME} - spec: + spec: host: ${APPLICATION_DOMAIN} port: targetPort: "8080-tcp" From 6b84bfead481c5ae26b6888643f6c345bc4f215e Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 22:27:50 -0800 Subject: [PATCH 66/94] Update update-configmap.sh --- openshift/update-configmap.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openshift/update-configmap.sh b/openshift/update-configmap.sh index da88a5eb2..c16c25753 100644 --- a/openshift/update-configmap.sh +++ b/openshift/update-configmap.sh @@ -11,13 +11,13 @@ ASPNETCORE_ENVIRONMENT=$6 DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT=$7 DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL=$8 DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL=$9 -DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL=$10 -DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL=$11 +DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL=${10} +DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL=${11} -ASPNETCORE_ENVIRONMENT_CAS=$12 -CAS_API_SERVER=$13 -CAS_TOKEN_URI=$14 -CAS_INVOICE_URI=$15 +ASPNETCORE_ENVIRONMENT_CAS=${12} +CAS_API_SERVER=${13} +CAS_TOKEN_URI=${14} +CAS_INVOICE_URI=${15} ########################################################### #Setup for config-maps From 648cbeb7f2086be399a85ac377987327033e5f46 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Fri, 22 Nov 2024 22:36:18 -0800 Subject: [PATCH 67/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 6215e015f..f1312ee09 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -248,7 +248,7 @@ jobs: ${{env.ASPNETCORE_ENVIRONMENT}} ${{env.DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT}} \ ${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}} \ ${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL}} \ - ${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL}}\ + ${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL}} \ ${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL}} ${{env.ASPNETCORE_ENVIRONMENT_CAS}} \ ${{env.CAS_API_SERVER}} ${{env.CAS_TOKEN_URI}} ${{env.CAS_INVOICE_URI}} From 9025e8322f93cc08a10e3ca12b6483171a11eade Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Mon, 25 Nov 2024 08:27:35 -0800 Subject: [PATCH 68/94] Update update-configmap.sh --- openshift/update-configmap.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/openshift/update-configmap.sh b/openshift/update-configmap.sh index c16c25753..a5b6570f5 100644 --- a/openshift/update-configmap.sh +++ b/openshift/update-configmap.sh @@ -1,7 +1,7 @@ ########################################################### #ENV VARS ########################################################### -APP_NAME=$1 +REPO_NAME=$1 NAMESPACE=$2 APP_DEBUG=$3 DOCUMENTROOT=$4 @@ -22,8 +22,7 @@ CAS_INVOICE_URI=${15} ########################################################### #Setup for config-maps ########################################################### -echo Creating config map "$APP_NAME"-config-map -echo "$NAMESPACE" +echo Creating config map "$REPO_NAME"-config-map oc create configmap ecas-config-map \ --from-literal=APP_DEBUG="$APP_DEBUG" \ --from-literal=DOCUMENTROOT="$DOCUMENTROOT" \ @@ -40,7 +39,7 @@ oc create configmap ecas-config-map \ --from-literal=CAS_INVOICE_URI="$CAS_INVOICE_URI" \ --dry-run=client -o yaml | oc apply -f - -echo Creating config map "$APP_NAME"-flb-sc-config-map +echo Creating config map "$REPO_NAME"-flb-sc-config-map oc create configmap ecas-flb-sc-config-map \ --from-literal=fluent-bit.conf="$FLB_CONFIG" \ --from-literal=parsers.conf="$PARSER_CONFIG" \ From a0637668078d44849200a9debb2e47b3d793213b Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Mon, 25 Nov 2024 08:33:55 -0800 Subject: [PATCH 69/94] Update update-configmap.sh --- openshift/update-configmap.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openshift/update-configmap.sh b/openshift/update-configmap.sh index a5b6570f5..960720373 100644 --- a/openshift/update-configmap.sh +++ b/openshift/update-configmap.sh @@ -23,7 +23,7 @@ CAS_INVOICE_URI=${15} #Setup for config-maps ########################################################### echo Creating config map "$REPO_NAME"-config-map -oc create configmap ecas-config-map \ +oc create configmap "$REPO_NAME"-config-map \ --from-literal=APP_DEBUG="$APP_DEBUG" \ --from-literal=DOCUMENTROOT="$DOCUMENTROOT" \ --from-literal=DYNAMICSBASEURL="$DYNAMICSBASEURL" \ @@ -40,7 +40,7 @@ oc create configmap ecas-config-map \ --dry-run=client -o yaml | oc apply -f - echo Creating config map "$REPO_NAME"-flb-sc-config-map -oc create configmap ecas-flb-sc-config-map \ +oc create configmap "$REPO_NAME"-flb-sc-config-map \ --from-literal=fluent-bit.conf="$FLB_CONFIG" \ --from-literal=parsers.conf="$PARSER_CONFIG" \ --dry-run=client -o yaml | oc apply -f - From 998ba1dd4e2cb964b422506a833b0ce653047ff4 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Mon, 25 Nov 2024 14:11:34 -0800 Subject: [PATCH 70/94] Update build.from.master.branch.deploy.to.dev.yml --- ...build.from.master.branch.deploy.to.dev.yml | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index f1312ee09..449717063 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -52,6 +52,10 @@ env: HOST_ROUTE: '${{ secrets.SITE_URL }}' BRANCH: "Github_action_fixes" + CA_CERT: ${{ secrets.CA_CERT }} + CERTIFICATE: ${{ secrets.CERT }} + PRIVATE_KEY: ${{ secrets.PRIV_KEY }} + on: workflow_dispatch: @@ -136,6 +140,7 @@ jobs: - name: Setup and Build cas api id: build-image-cas + if: false uses: redhat-actions/s2i-build@v2 with: path_context: ./EDUC-HUB @@ -147,6 +152,7 @@ jobs: - name: Setup and Build ecas api id: build-image-api + if: false uses: redhat-actions/s2i-build@v2 with: path_context: ./web-api/Ecas.Dyn365Service @@ -155,7 +161,6 @@ jobs: tags: ${{ env.TAG }} - name: Setup and Build Frontend - if: false id: build-image-frontend uses: redhat-actions/s2i-build@v2 with: @@ -174,7 +179,6 @@ jobs: run: docker images - name: Push frontend to registry - if: false id: push-image-frontend uses: redhat-actions/push-to-registry@v2 with: @@ -186,6 +190,7 @@ jobs: - name: Push api to registry id: push-image-api + if: false uses: redhat-actions/push-to-registry@v2 with: image: ${{ steps.build-image-api.outputs.image }} @@ -196,6 +201,7 @@ jobs: - name: Push cas to registry id: push-image-cas + if: false uses: redhat-actions/push-to-registry@v2 with: image: ${{ steps.build-image-cas.outputs.image }} @@ -227,19 +233,19 @@ jobs: # Create the image stream if it doesn't exist - #oc create imagestream ${{ env.REPO_NAME }}-frontend> /dev/null || true && echo "Frontend image stream in place" - oc create imagestream ${{ env.REPO_NAME }}-api> /dev/null || true && echo "Ecas API image stream in place" - oc create imagestream ${{ env.REPO_NAME }}-cas-api> /dev/null || true && echo "CAS API image stream in place" + oc create imagestream ${{ env.REPO_NAME }}-frontend> /dev/null || true && echo "Frontend image stream in place" + #oc create imagestream ${{ env.REPO_NAME }}-api> /dev/null || true && echo "Ecas API image stream in place" + #oc create imagestream ${{ env.REPO_NAME }}-cas-api> /dev/null || true && echo "CAS API image stream in place" - #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-frontend.outputs.registry-path }} ${{ env.REPO_NAME }}-frontend:${{ env.TAG }} + oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-frontend.outputs.registry-path }} ${{ env.REPO_NAME }}-frontend:${{ env.TAG }} - oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-api.outputs.registry-path }} ${{env.REPO_NAME }}-api:${{ env.TAG }} + #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-api.outputs.registry-path }} ${{env.REPO_NAME }}-api:${{ env.TAG }} - oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} + #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} \ ${{ env.OPENSHIFT_NAMESPACE_DEV }} \ @@ -261,17 +267,17 @@ jobs: # Process and apply deployment template - #oc process -f ./openshift/templates/ecas-frontend/frontend.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE}}\ - #| oc apply -f - + oc process -f ./openshift/templates/ecas-frontend/frontend.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE}} -p HOST_ROUTE=${{ env.HOST_ROUTE }} -p CA_CERT="${{ env.CA_CERT }}" -p CERTIFICATE="${{ env.CERTIFICATE }}" -p PRIVATE_KEY="${{ env.PRIVATE_KEY }}" \ + | oc apply -f - - oc process -f ./openshift/templates/ecas-api/api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }}\ - | oc apply -f - + #oc process -f ./openshift/templates/ecas-api/api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }}\ + #| oc apply -f - - oc process -f ./openshift/templates/cas-api/cas-api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }}\ - | oc apply -f - + #oc process -f ./openshift/templates/cas-api/cas-api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }}\ + #| oc apply -f - - name: ZAP Scan From 161e41be84092ff9ed67a4d44125a9f282783133 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Mon, 25 Nov 2024 14:18:05 -0800 Subject: [PATCH 71/94] Update frontend.dc.yaml --- .../templates/ecas-frontend/frontend.dc.yaml | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/openshift/templates/ecas-frontend/frontend.dc.yaml b/openshift/templates/ecas-frontend/frontend.dc.yaml index 4cb48a9a5..522339ee0 100644 --- a/openshift/templates/ecas-frontend/frontend.dc.yaml +++ b/openshift/templates/ecas-frontend/frontend.dc.yaml @@ -121,6 +121,30 @@ name: "${APP_NAME}-frontend" app: ${APP_NAME} app-group: ${APP_NAME} + spec: + host: ${HOST_ROUTE} + port: + targetPort: "${APP_NAME}-frontend" + tls: + tls: + caCertificate: "${CA_CERT}" + certificate: "${CERTIFICATE}" + insecureEdgeTerminationPolicy: Redirect + key: "${PRIVATE_KEY}" + termination: edge + to: + kind: Service + name: "${APP_NAME}-frontend" + weight: 100 + + - apiVersion: v1 + kind: Route + metadata: + name: "dev-workwitheducation" + labels: + name: "${APP_NAME}-frontend" + app: ${APP_NAME} + app-group: ${APP_NAME} spec: host: ${APPLICATION_DOMAIN} port: @@ -228,4 +252,4 @@ displayName: Application Hostname description: The exposed hostname that will route to the service, if left blank a value will be defaulted. required: false - value: "" \ No newline at end of file + value: "" From 5d710d1fd9600ee30a5a1d161bbeca7fb591e175 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Mon, 25 Nov 2024 14:30:25 -0800 Subject: [PATCH 72/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 449717063..60140f1ec 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -267,7 +267,7 @@ jobs: # Process and apply deployment template - oc process -f ./openshift/templates/ecas-frontend/frontend.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE}} -p HOST_ROUTE=${{ env.HOST_ROUTE }} -p CA_CERT="${{ env.CA_CERT }}" -p CERTIFICATE="${{ env.CERTIFICATE }}" -p PRIVATE_KEY="${{ env.PRIVATE_KEY }}" \ + oc process -f ./openshift/templates/ecas-frontend/frontend.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE}} -p CA_CERT="${{ env.CA_CERT }}" -p CERTIFICATE="${{ env.CERTIFICATE }}" -p PRIVATE_KEY="${{ env.PRIVATE_KEY }}" \ | oc apply -f - From f5f18fc3a968a71da067f3d8ffdd68bb4e106d8d Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Mon, 25 Nov 2024 14:41:46 -0800 Subject: [PATCH 73/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 60140f1ec..f950c45a0 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -267,7 +267,7 @@ jobs: # Process and apply deployment template - oc process -f ./openshift/templates/ecas-frontend/frontend.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE}} -p CA_CERT="${{ env.CA_CERT }}" -p CERTIFICATE="${{ env.CERTIFICATE }}" -p PRIVATE_KEY="${{ env.PRIVATE_KEY }}" \ + oc process -f ./openshift/templates/ecas-frontend/frontend.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE}} -p CA_CERT="${{ env.CA_CERT }}" -p CERTIFICATE="${{ env.CERTIFICATE }}" -p PRIVATE_KEY="${{ env.PRIVATE_KEY }}"\ | oc apply -f - From 98715c8b774682e8808459dbab0f5b9cce6b6ed8 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Mon, 25 Nov 2024 14:55:36 -0800 Subject: [PATCH 74/94] Update frontend.dc.yaml --- openshift/templates/ecas-frontend/frontend.dc.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/openshift/templates/ecas-frontend/frontend.dc.yaml b/openshift/templates/ecas-frontend/frontend.dc.yaml index 522339ee0..5e0c1fe01 100644 --- a/openshift/templates/ecas-frontend/frontend.dc.yaml +++ b/openshift/templates/ecas-frontend/frontend.dc.yaml @@ -253,3 +253,12 @@ description: The exposed hostname that will route to the service, if left blank a value will be defaulted. required: false value: "" + - name: CA_CERT + description: The minimum amount of replicas + required: true + - name: CERTIFICATE + description: The minimum amount of replicas + required: true + - name: PRIVATE_KEY + description: The minimum amount of replicas + required: true From d0234887db3c344fd304b6e8f16d9ca426e5fd21 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Mon, 25 Nov 2024 15:14:24 -0800 Subject: [PATCH 75/94] Update frontend.dc.yaml --- openshift/templates/ecas-frontend/frontend.dc.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openshift/templates/ecas-frontend/frontend.dc.yaml b/openshift/templates/ecas-frontend/frontend.dc.yaml index 5e0c1fe01..d90808cd0 100644 --- a/openshift/templates/ecas-frontend/frontend.dc.yaml +++ b/openshift/templates/ecas-frontend/frontend.dc.yaml @@ -122,15 +122,12 @@ app: ${APP_NAME} app-group: ${APP_NAME} spec: - host: ${HOST_ROUTE} + host: ${APPLICATION_DOMAIN} port: targetPort: "${APP_NAME}-frontend" tls: tls: - caCertificate: "${CA_CERT}" - certificate: "${CERTIFICATE}" insecureEdgeTerminationPolicy: Redirect - key: "${PRIVATE_KEY}" termination: edge to: kind: Service @@ -146,12 +143,15 @@ app: ${APP_NAME} app-group: ${APP_NAME} spec: - host: ${APPLICATION_DOMAIN} + host: ${HOST_ROUTE} port: targetPort: "${APP_NAME}-frontend" tls: insecureEdgeTerminationPolicy: Redirect termination: edge + caCertificate: "${CA_CERT}" + certificate: "${CERTIFICATE + key: "${PRIVATE_KEY}" to: kind: Service name: "${APP_NAME}-frontend" From 230b62ad660b3b45a7c7b63567f782eed7285a66 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Mon, 25 Nov 2024 15:29:21 -0800 Subject: [PATCH 76/94] Update frontend.dc.yaml --- openshift/templates/ecas-frontend/frontend.dc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openshift/templates/ecas-frontend/frontend.dc.yaml b/openshift/templates/ecas-frontend/frontend.dc.yaml index d90808cd0..1e5a2a487 100644 --- a/openshift/templates/ecas-frontend/frontend.dc.yaml +++ b/openshift/templates/ecas-frontend/frontend.dc.yaml @@ -150,7 +150,7 @@ insecureEdgeTerminationPolicy: Redirect termination: edge caCertificate: "${CA_CERT}" - certificate: "${CERTIFICATE + certificate: "${CERTIFICATE}" key: "${PRIVATE_KEY}" to: kind: Service From c7b43faf8105af5333b2bbb4e8007d2201fc52be Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:50:05 -0800 Subject: [PATCH 77/94] Update build.from.master.branch.deploy.to.dev.yml --- ...build.from.master.branch.deploy.to.dev.yml | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index f950c45a0..56546a4bc 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -140,7 +140,6 @@ jobs: - name: Setup and Build cas api id: build-image-cas - if: false uses: redhat-actions/s2i-build@v2 with: path_context: ./EDUC-HUB @@ -152,7 +151,6 @@ jobs: - name: Setup and Build ecas api id: build-image-api - if: false uses: redhat-actions/s2i-build@v2 with: path_context: ./web-api/Ecas.Dyn365Service @@ -190,7 +188,6 @@ jobs: - name: Push api to registry id: push-image-api - if: false uses: redhat-actions/push-to-registry@v2 with: image: ${{ steps.build-image-api.outputs.image }} @@ -201,7 +198,6 @@ jobs: - name: Push cas to registry id: push-image-cas - if: false uses: redhat-actions/push-to-registry@v2 with: image: ${{ steps.build-image-cas.outputs.image }} @@ -234,18 +230,18 @@ jobs: # Create the image stream if it doesn't exist oc create imagestream ${{ env.REPO_NAME }}-frontend> /dev/null || true && echo "Frontend image stream in place" - #oc create imagestream ${{ env.REPO_NAME }}-api> /dev/null || true && echo "Ecas API image stream in place" - #oc create imagestream ${{ env.REPO_NAME }}-cas-api> /dev/null || true && echo "CAS API image stream in place" + oc create imagestream ${{ env.REPO_NAME }}-api> /dev/null || true && echo "Ecas API image stream in place" + oc create imagestream ${{ env.REPO_NAME }}-cas-api> /dev/null || true && echo "CAS API image stream in place" oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-frontend.outputs.registry-path }} ${{ env.REPO_NAME }}-frontend:${{ env.TAG }} - #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-api.outputs.registry-path }} ${{env.REPO_NAME }}-api:${{ env.TAG }} + oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-api.outputs.registry-path }} ${{env.REPO_NAME }}-api:${{ env.TAG }} - #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} + oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} \ ${{ env.OPENSHIFT_NAMESPACE_DEV }} \ @@ -272,12 +268,12 @@ jobs: - #oc process -f ./openshift/templates/ecas-api/api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }}\ - #| oc apply -f - + oc process -f ./openshift/templates/ecas-api/api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }}\ + | oc apply -f - - #oc process -f ./openshift/templates/cas-api/cas-api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }}\ - #| oc apply -f - + oc process -f ./openshift/templates/cas-api/cas-api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }}\ + | oc apply -f - - name: ZAP Scan From eb58619a994d4b75ed3bcd8e3234cafbda97c206 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Tue, 26 Nov 2024 16:04:43 -0800 Subject: [PATCH 78/94] Update cas-api.dc.yaml --- openshift/templates/cas-api/cas-api.dc.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openshift/templates/cas-api/cas-api.dc.yaml b/openshift/templates/cas-api/cas-api.dc.yaml index 083f9bb7f..36a8ee88e 100644 --- a/openshift/templates/cas-api/cas-api.dc.yaml +++ b/openshift/templates/cas-api/cas-api.dc.yaml @@ -37,20 +37,20 @@ valueFrom: configMapKeyRef: name: ${REPO_NAME}-config-map - key: ASPNETCORE_ENVIRONMENT_CAS + key: ASPNETCORE_ENVIRONMENT_CAS - name: CAS_API_SERVER valueFrom: configMapKeyRef: name: ${REPO_NAME}-config-map - key: CAS_API_SERVER + key: CAS_API_SERVER - name: CAS_TOKEN_URI configMapKeyRef: name: ${REPO_NAME}-config-map - key: CAS_TOKEN_URI + key: CAS_TOKEN_URI - name: CAS_INVOICE_URI configMapKeyRef: name: ${REPO_NAME}-config-map - key: CAS_INVOICE_URI + key: CAS_INVOICE_URI ports: - containerPort: 8080 protocol: TCP From ed53b7911cbed5a82b984f99428b1a35dbe5794d Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Tue, 26 Nov 2024 16:06:21 -0800 Subject: [PATCH 79/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 56546a4bc..1e849bb5f 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -160,6 +160,7 @@ jobs: - name: Setup and Build Frontend id: build-image-frontend + if: false uses: redhat-actions/s2i-build@v2 with: path_context: ./web-app @@ -178,6 +179,7 @@ jobs: - name: Push frontend to registry id: push-image-frontend + if: false uses: redhat-actions/push-to-registry@v2 with: image: ${{ steps.build-image-frontend.outputs.image }} From e7291d8118794ad8b9ac84e678b91672af3ee83a Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Tue, 26 Nov 2024 16:11:04 -0800 Subject: [PATCH 80/94] Update build.from.master.branch.deploy.to.dev.yml --- .../workflows/build.from.master.branch.deploy.to.dev.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 1e849bb5f..7a6153634 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -14,7 +14,7 @@ env: IMAGE_REGISTRY_USER: '${{ github.actor }}' IMAGE_REGISTRY_PASSWORD: '${{ github.token }}' APP_NAME_FRONTEND: ecas-frontend - APP_NAME_API: ecas-api + APP_NAME_API: APP_NAME_CAS: cas-api REDHAT_REGISTRY: https://registry.redhat.io @@ -151,6 +151,7 @@ jobs: - name: Setup and Build ecas api id: build-image-api + if: false uses: redhat-actions/s2i-build@v2 with: path_context: ./web-api/Ecas.Dyn365Service @@ -190,6 +191,7 @@ jobs: - name: Push api to registry id: push-image-api + if: false uses: redhat-actions/push-to-registry@v2 with: image: ${{ steps.build-image-api.outputs.image }} @@ -236,10 +238,10 @@ jobs: oc create imagestream ${{ env.REPO_NAME }}-cas-api> /dev/null || true && echo "CAS API image stream in place" - oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-frontend.outputs.registry-path }} ${{ env.REPO_NAME }}-frontend:${{ env.TAG }} + #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-frontend.outputs.registry-path }} ${{ env.REPO_NAME }}-frontend:${{ env.TAG }} - oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-api.outputs.registry-path }} ${{env.REPO_NAME }}-api:${{ env.TAG }} + #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-api.outputs.registry-path }} ${{env.REPO_NAME }}-api:${{ env.TAG }} From 6dd319811310ce31dd5960c505c48ddbe1a1fa98 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Tue, 26 Nov 2024 16:14:51 -0800 Subject: [PATCH 81/94] Update cas-api.dc.yaml --- openshift/templates/cas-api/cas-api.dc.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openshift/templates/cas-api/cas-api.dc.yaml b/openshift/templates/cas-api/cas-api.dc.yaml index 36a8ee88e..2189a6d69 100644 --- a/openshift/templates/cas-api/cas-api.dc.yaml +++ b/openshift/templates/cas-api/cas-api.dc.yaml @@ -44,10 +44,12 @@ name: ${REPO_NAME}-config-map key: CAS_API_SERVER - name: CAS_TOKEN_URI + valueFrom: configMapKeyRef: name: ${REPO_NAME}-config-map key: CAS_TOKEN_URI - name: CAS_INVOICE_URI + valueFrom: configMapKeyRef: name: ${REPO_NAME}-config-map key: CAS_INVOICE_URI From d74ec359ed2318c5c67cd1f1cfa5c264bb19ff2b Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Tue, 26 Nov 2024 16:26:02 -0800 Subject: [PATCH 82/94] Update cas-api.dc.yaml --- openshift/templates/cas-api/cas-api.dc.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openshift/templates/cas-api/cas-api.dc.yaml b/openshift/templates/cas-api/cas-api.dc.yaml index 2189a6d69..1e9d0aed1 100644 --- a/openshift/templates/cas-api/cas-api.dc.yaml +++ b/openshift/templates/cas-api/cas-api.dc.yaml @@ -45,12 +45,12 @@ key: CAS_API_SERVER - name: CAS_TOKEN_URI valueFrom: - configMapKeyRef: + configMapKeyRef: name: ${REPO_NAME}-config-map key: CAS_TOKEN_URI - name: CAS_INVOICE_URI valueFrom: - configMapKeyRef: + configMapKeyRef: name: ${REPO_NAME}-config-map key: CAS_INVOICE_URI ports: From e036af2faa52e7a81a7a93ad9d521947c3ea938f Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Wed, 27 Nov 2024 10:15:10 -0800 Subject: [PATCH 83/94] Update build.from.master.branch.deploy.to.dev.yml --- .../workflows/build.from.master.branch.deploy.to.dev.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 7a6153634..ceb00b5c7 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -140,6 +140,7 @@ jobs: - name: Setup and Build cas api id: build-image-cas + if: false uses: redhat-actions/s2i-build@v2 with: path_context: ./EDUC-HUB @@ -161,7 +162,6 @@ jobs: - name: Setup and Build Frontend id: build-image-frontend - if: false uses: redhat-actions/s2i-build@v2 with: path_context: ./web-app @@ -180,7 +180,6 @@ jobs: - name: Push frontend to registry id: push-image-frontend - if: false uses: redhat-actions/push-to-registry@v2 with: image: ${{ steps.build-image-frontend.outputs.image }} @@ -202,6 +201,7 @@ jobs: - name: Push cas to registry id: push-image-cas + if: false uses: redhat-actions/push-to-registry@v2 with: image: ${{ steps.build-image-cas.outputs.image }} @@ -238,14 +238,14 @@ jobs: oc create imagestream ${{ env.REPO_NAME }}-cas-api> /dev/null || true && echo "CAS API image stream in place" - #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-frontend.outputs.registry-path }} ${{ env.REPO_NAME }}-frontend:${{ env.TAG }} + oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-frontend.outputs.registry-path }} ${{ env.REPO_NAME }}-frontend:${{ env.TAG }} #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-api.outputs.registry-path }} ${{env.REPO_NAME }}-api:${{ env.TAG }} - oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} + #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} \ ${{ env.OPENSHIFT_NAMESPACE_DEV }} \ From b3661d676867d51b4a634e723afa70544f7319e8 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Wed, 27 Nov 2024 10:19:08 -0800 Subject: [PATCH 84/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index ceb00b5c7..1b4d6e3b2 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -14,7 +14,7 @@ env: IMAGE_REGISTRY_USER: '${{ github.actor }}' IMAGE_REGISTRY_PASSWORD: '${{ github.token }}' APP_NAME_FRONTEND: ecas-frontend - APP_NAME_API: + APP_NAME_API: ecas-api APP_NAME_CAS: cas-api REDHAT_REGISTRY: https://registry.redhat.io From 4e3223b7f544b27a9535f5b349beccb4faf173b6 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Wed, 27 Nov 2024 10:20:57 -0800 Subject: [PATCH 85/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 1b4d6e3b2..fd9f566b7 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -32,7 +32,7 @@ env: MAX_MEM: 500Mi #frontend config maps vars - APP_DEBUG: false + APP_DEBUG: 'false' DYNAMICSBASEURL: http://ecas-api:8080/api DOCUMENTROOT: /public #ecas api config maps vars @@ -249,7 +249,7 @@ jobs: curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} \ ${{ env.OPENSHIFT_NAMESPACE_DEV }} \ - ${{ env.APP_DEBUG}} ${{ env.DOCUMENTROOT }} \ + ${{env.APP_DEBUG}} ${{env.DOCUMENTROOT}} \ ${{ env.DYNAMICSBASEURL}} \ ${{env.ASPNETCORE_ENVIRONMENT}} ${{env.DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT}} \ ${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}} \ From 6b3137196beb32e505f210e8859f0238bd7384cf Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Wed, 27 Nov 2024 10:26:21 -0800 Subject: [PATCH 86/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index fd9f566b7..65fa39e8e 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -249,7 +249,7 @@ jobs: curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} \ ${{ env.OPENSHIFT_NAMESPACE_DEV }} \ - ${{env.APP_DEBUG}} ${{env.DOCUMENTROOT}} \ + ${{env.APP_DEBUG}} ${{env.DOCUMENTROOT}} \ ${{ env.DYNAMICSBASEURL}} \ ${{env.ASPNETCORE_ENVIRONMENT}} ${{env.DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT}} \ ${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}} \ From af0e8f5188cc0c2687b7b8b39f71b92420877e07 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Wed, 27 Nov 2024 10:47:33 -0800 Subject: [PATCH 87/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 65fa39e8e..51a4722f0 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -32,7 +32,7 @@ env: MAX_MEM: 500Mi #frontend config maps vars - APP_DEBUG: 'false' + APP_DEBUG: 'FALSE' DYNAMICSBASEURL: http://ecas-api:8080/api DOCUMENTROOT: /public #ecas api config maps vars From 1c02c3563d5d7a5784d751f73dd373802b190e2e Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Wed, 27 Nov 2024 11:01:56 -0800 Subject: [PATCH 88/94] Update frontend.dc.yaml --- openshift/templates/ecas-frontend/frontend.dc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openshift/templates/ecas-frontend/frontend.dc.yaml b/openshift/templates/ecas-frontend/frontend.dc.yaml index 1e5a2a487..db434a8b1 100644 --- a/openshift/templates/ecas-frontend/frontend.dc.yaml +++ b/openshift/templates/ecas-frontend/frontend.dc.yaml @@ -238,7 +238,7 @@ - name: APP_DEBUG displayName: Application Debug required: true - value: "false" + value: "FALSE" - name: DOCUMENTROOT displayName: Document Root required: true From 8f13618f43154d96d184dcb1e9d94629b3b4dfdd Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Wed, 27 Nov 2024 11:04:23 -0800 Subject: [PATCH 89/94] Update frontend.dc.yaml --- openshift/templates/ecas-frontend/frontend.dc.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/openshift/templates/ecas-frontend/frontend.dc.yaml b/openshift/templates/ecas-frontend/frontend.dc.yaml index db434a8b1..7e1f912e3 100644 --- a/openshift/templates/ecas-frontend/frontend.dc.yaml +++ b/openshift/templates/ecas-frontend/frontend.dc.yaml @@ -36,10 +36,7 @@ name: "${APP_NAME}-frontend" env: - name: APP_DEBUG - valueFrom: - configMapKeyRef: - name: ${REPO_NAME}-config-map - key: APP_DEBUG + value: ${APP_DEBUG} - name: DYNAMICSBASEURL valueFrom: configMapKeyRef: From 3885606dcb4fb9a2ac67e8cc009f1b052097e8ce Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Wed, 27 Nov 2024 12:23:10 -0800 Subject: [PATCH 90/94] Update build.from.master.branch.deploy.to.dev.yml --- ...build.from.master.branch.deploy.to.dev.yml | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 51a4722f0..abe7e8221 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -152,7 +152,6 @@ jobs: - name: Setup and Build ecas api id: build-image-api - if: false uses: redhat-actions/s2i-build@v2 with: path_context: ./web-api/Ecas.Dyn365Service @@ -162,6 +161,7 @@ jobs: - name: Setup and Build Frontend id: build-image-frontend + if: false uses: redhat-actions/s2i-build@v2 with: path_context: ./web-app @@ -180,6 +180,7 @@ jobs: - name: Push frontend to registry id: push-image-frontend + if: false uses: redhat-actions/push-to-registry@v2 with: image: ${{ steps.build-image-frontend.outputs.image }} @@ -201,7 +202,6 @@ jobs: - name: Push cas to registry id: push-image-cas - if: false uses: redhat-actions/push-to-registry@v2 with: image: ${{ steps.build-image-cas.outputs.image }} @@ -238,25 +238,25 @@ jobs: oc create imagestream ${{ env.REPO_NAME }}-cas-api> /dev/null || true && echo "CAS API image stream in place" - oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-frontend.outputs.registry-path }} ${{ env.REPO_NAME }}-frontend:${{ env.TAG }} + #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-frontend.outputs.registry-path }} ${{ env.REPO_NAME }}-frontend:${{ env.TAG }} #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-api.outputs.registry-path }} ${{env.REPO_NAME }}-api:${{ env.TAG }} - #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} - - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin ${{ env.REPO_NAME }} \ - ${{ env.OPENSHIFT_NAMESPACE_DEV }} \ - ${{env.APP_DEBUG}} ${{env.DOCUMENTROOT}} \ - ${{ env.DYNAMICSBASEURL}} \ - ${{env.ASPNETCORE_ENVIRONMENT}} ${{env.DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT}} \ - ${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}} \ - ${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL}} \ - ${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL}} \ - ${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL}} ${{env.ASPNETCORE_ENVIRONMENT_CAS}} \ - ${{env.CAS_API_SERVER}} ${{env.CAS_TOKEN_URI}} ${{env.CAS_INVOICE_URI}} + oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} + + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin "${{ env.REPO_NAME }}" \ + "${{ env.OPENSHIFT_NAMESPACE_DEV }}" \ + "${{env.APP_DEBUG}}" "${{env.DOCUMENTROOT}}" \ + "${{ env.DYNAMICSBASEURL}}" \ + "${{env.ASPNETCORE_ENVIRONMENT}}" "${{env.DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT}}" \ + "${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}}" \ + "${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL}}" \ + "${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL}}" \ + "${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL}}" "${{env.ASPNETCORE_ENVIRONMENT_CAS}}" \ + "${{env.CAS_API_SERVER}}" "${{env.CAS_TOKEN_URI}}" "${{env.CAS_INVOICE_URI}}" From a34b6b309c887896e9dc07b78e9e1cb86fe0562b Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Wed, 27 Nov 2024 12:38:47 -0800 Subject: [PATCH 91/94] Update build.from.master.branch.deploy.to.dev.yml --- .github/workflows/build.from.master.branch.deploy.to.dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index abe7e8221..377228a3f 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -140,7 +140,6 @@ jobs: - name: Setup and Build cas api id: build-image-cas - if: false uses: redhat-actions/s2i-build@v2 with: path_context: ./EDUC-HUB @@ -152,6 +151,7 @@ jobs: - name: Setup and Build ecas api id: build-image-api + if: false uses: redhat-actions/s2i-build@v2 with: path_context: ./web-api/Ecas.Dyn365Service From f68cb33a1aae748374473023a4f90ef739a41ec0 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Wed, 27 Nov 2024 12:49:23 -0800 Subject: [PATCH 92/94] Update build.from.master.branch.deploy.to.dev.yml --- .../build.from.master.branch.deploy.to.dev.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index 377228a3f..b20baaff3 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -247,24 +247,9 @@ jobs: oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-cas.outputs.registry-path }} ${{env.REPO_NAME }}-cas-api:${{ env.TAG }} - curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin "${{ env.REPO_NAME }}" \ - "${{ env.OPENSHIFT_NAMESPACE_DEV }}" \ - "${{env.APP_DEBUG}}" "${{env.DOCUMENTROOT}}" \ - "${{ env.DYNAMICSBASEURL}}" \ - "${{env.ASPNETCORE_ENVIRONMENT}}" "${{env.DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT}}" \ - "${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}}" \ - "${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL}}" \ - "${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL}}" \ - "${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL}}" "${{env.ASPNETCORE_ENVIRONMENT_CAS}}" \ - "${{env.CAS_API_SERVER}}" "${{env.CAS_TOKEN_URI}}" "${{env.CAS_INVOICE_URI}}" + curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/openshift/update-configmap.sh | bash /dev/stdin "${{ env.REPO_NAME }}" "${{ env.OPENSHIFT_NAMESPACE_DEV }}" "${{env.APP_DEBUG}}" "${{env.DOCUMENTROOT}}" "${{ env.DYNAMICSBASEURL}}" "${{env.ASPNETCORE_ENVIRONMENT}}" "${{env.DYNAMICSAUTHENTICATIONSETTINGS__ACTIVEENVIRONMENT}}" "${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDWEBAPIURL}}" "${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDREDIRECTURL}}" "${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDRESOURCEURL}}" "${{env.DYNAMICSAUTHENTICATIONSETTINGS__CLOUDBASEURL}}" "${{env.ASPNETCORE_ENVIRONMENT_CAS}}" "${{env.CAS_API_SERVER}}" "${{env.CAS_TOKEN_URI}}" "${{env.CAS_INVOICE_URI}}" - - - - - - # Process and apply deployment template oc process -f ./openshift/templates/ecas-frontend/frontend.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE}} -p CA_CERT="${{ env.CA_CERT }}" -p CERTIFICATE="${{ env.CERTIFICATE }}" -p PRIVATE_KEY="${{ env.PRIVATE_KEY }}"\ From f4a05802f407b44395585a87ec47bd2263c6dc47 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Wed, 27 Nov 2024 12:53:01 -0800 Subject: [PATCH 93/94] Update build.from.master.branch.deploy.to.dev.yml --- .../workflows/build.from.master.branch.deploy.to.dev.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.from.master.branch.deploy.to.dev.yml b/.github/workflows/build.from.master.branch.deploy.to.dev.yml index b20baaff3..cee2f40bf 100644 --- a/.github/workflows/build.from.master.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.master.branch.deploy.to.dev.yml @@ -151,7 +151,6 @@ jobs: - name: Setup and Build ecas api id: build-image-api - if: false uses: redhat-actions/s2i-build@v2 with: path_context: ./web-api/Ecas.Dyn365Service @@ -161,7 +160,6 @@ jobs: - name: Setup and Build Frontend id: build-image-frontend - if: false uses: redhat-actions/s2i-build@v2 with: path_context: ./web-app @@ -180,7 +178,6 @@ jobs: - name: Push frontend to registry id: push-image-frontend - if: false uses: redhat-actions/push-to-registry@v2 with: image: ${{ steps.build-image-frontend.outputs.image }} @@ -191,7 +188,6 @@ jobs: - name: Push api to registry id: push-image-api - if: false uses: redhat-actions/push-to-registry@v2 with: image: ${{ steps.build-image-api.outputs.image }} @@ -238,10 +234,10 @@ jobs: oc create imagestream ${{ env.REPO_NAME }}-cas-api> /dev/null || true && echo "CAS API image stream in place" - #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-frontend.outputs.registry-path }} ${{ env.REPO_NAME }}-frontend:${{ env.TAG }} + oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-frontend.outputs.registry-path }} ${{ env.REPO_NAME }}-frontend:${{ env.TAG }} - #oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-api.outputs.registry-path }} ${{env.REPO_NAME }}-api:${{ env.TAG }} + oc tag -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} ${{ steps.push-image-api.outputs.registry-path }} ${{env.REPO_NAME }}-api:${{ env.TAG }} From 1cf38635135c26e5180cae3dbf6f00801a459455 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Wed, 27 Nov 2024 12:55:20 -0800 Subject: [PATCH 94/94] Update frontend.dc.yaml --- openshift/templates/ecas-frontend/frontend.dc.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openshift/templates/ecas-frontend/frontend.dc.yaml b/openshift/templates/ecas-frontend/frontend.dc.yaml index 7e1f912e3..bde770bc1 100644 --- a/openshift/templates/ecas-frontend/frontend.dc.yaml +++ b/openshift/templates/ecas-frontend/frontend.dc.yaml @@ -36,7 +36,10 @@ name: "${APP_NAME}-frontend" env: - name: APP_DEBUG - value: ${APP_DEBUG} + valueFrom: + configMapKeyRef: + name: ${REPO_NAME}-config-map + key: APP_DEBUG - name: DYNAMICSBASEURL valueFrom: configMapKeyRef: