From 324c70ceeb0dedd6fae1750f9f80efb9ea550dda Mon Sep 17 00:00:00 2001 From: sakthi-aot Date: Fri, 24 Jan 2025 14:43:10 -0700 Subject: [PATCH] test migrate --- .../openshift/deploy.backend-applications.yml | 18 ++-- .github/openshift/deploy.frontend.yml | 96 +++++++++++++------ .github/workflows/ci-cd-openshift-dev.yaml | 2 +- 3 files changed, 76 insertions(+), 40 deletions(-) diff --git a/.github/openshift/deploy.backend-applications.yml b/.github/openshift/deploy.backend-applications.yml index a51e08fe..3f1f7475 100644 --- a/.github/openshift/deploy.backend-applications.yml +++ b/.github/openshift/deploy.backend-applications.yml @@ -83,8 +83,8 @@ objects: name: ${REGISTRY}/${INIT_IMAGE}:${IMAGE_TAG} referencePolicy: type: Local -- apiVersion: apps/v1 - kind: Deployment +- apiVersion: v1 + kind: DeploymentConfig metadata: labels: app: ${NAME}-${COMPONENT} @@ -102,16 +102,14 @@ objects: kind: ImageStreamTag name: ${NAME}-${COMPONENT}:${IMAGE_TAG} selector: - matchLabels: - app: ${NAME}-${COMPONENT} - deployment: ${NAME}-${COMPONENT} + deploymentconfig: ${NAME}-${COMPONENT} strategy: - type: RollingUpdate + type: Rolling template: metadata: labels: app: ${NAME}-${COMPONENT} - deployment: ${NAME}-${COMPONENT} + deploymentconfig: ${NAME}-${COMPONENT} spec: containers: - image: " " @@ -283,7 +281,7 @@ objects: port: 80 targetPort: ${{CONTAINER_PORT}} selector: - deployment: ${NAME}-${COMPONENT} + deploymentconfig: ${NAME}-${COMPONENT} - apiVersion: route.openshift.io/v1 kind: Route metadata: @@ -307,8 +305,8 @@ objects: name: "${NAME}-${COMPONENT}" spec: scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment + apiVersion: apps.openshift.io/v1 + kind: DeploymentConfig name: "${NAME}-${COMPONENT}" minReplicas: ${{MIN_REPLICAS}} maxReplicas: ${{MAX_REPLICAS}} diff --git a/.github/openshift/deploy.frontend.yml b/.github/openshift/deploy.frontend.yml index 20c33db5..a0ae0bed 100644 --- a/.github/openshift/deploy.frontend.yml +++ b/.github/openshift/deploy.frontend.yml @@ -2,13 +2,9 @@ apiVersion: template.openshift.io/v1 kind: Template metadata: name: ${NAME} - annotations: - description: "EPD Digital Services" - tags: "EPD" - iconClass: icon-js -labels: - app: ${NAME}-${COMPONENT} - app.kubernetes.io/part-of: ${NAME}-${COMPONENT} + labels: + app: ${NAME}-${COMPONENT} + app.kubernetes.io/part-of: ${NAME}-${COMPONENT} parameters: - name: NAME description: Module name @@ -51,13 +47,66 @@ parameters: description: "The keycloak client id" value: epd-web objects: -# ConfigMap created by sakthi for testing - DONOT push - apiVersion: v1 kind: ConfigMap metadata: name: ${NAME}epd-config data: - config.js: "// runtime-config.js vars\n window[\"_env_\"] = {\n \"REACT_APP_NODE_ENV\": \"production\",\n \"REACT_APP_AUTH_AUTHORITY\": \"https://epd-keycloak-${ENV}.apps.silver.devops.gov.bc.ca/auth/realms/forms-flow-ai/\",\n \"REACT_APP_AUTH_CLIENT_ID\": \"${REACT_APP_AUTH_CLIENT_ID}\",\n \"REACT_APP_AUTH_REDIRECT_URI\": \"https://epd-frontend-${ENV}.apps.silver.devops.gov.bc.ca/dashboard\", \n \"REACT_APP_AUTH_LOGOUT_REDIRECT_URI\": \"https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi?retnow=1&returl=https://epd-keycloak-${ENV}.apps.silver.devops.gov.bc.ca/auth/realms/forms-flow-ai/protocol/openid-connect/logout?post_logout_redirect_uri=https://epd-frontend-${ENV}.apps.silver.devops.gov.bc.ca\",\n \"REACT_APP_AUTH_RESPONSE_TYPE\": \"code\",\n \"REACT_APP_AUTH_SCOPE\": \"openid profile\",\n \"REACT_APP_BACKEND_API\": \"https://epd-backend-gateway-${ENV}.apps.silver.devops.gov.bc.ca\", \n \"REACT_APP_AUTH_FILTER_PROTOCOL_CLAIMS\": \"true\",\n \"REACT_APP_AUTH_LOAD_USER_INFO\": \"true\", \n \"REACT_APP_AUTH_REVOKE_TOKENS_ON_SIGNOUT\": \"true\",\n \"REACT_APP_FORMSFLOW_WEB_URL\": \"https://forms-flow-web-root-config-${ENV}.apps.silver.devops.gov.bc.ca/\",\n \"REACT_APP_CUSTOM_MAP_URL\": \"https://epd-frontend-${ENV}.apps.silver.devops.gov.bc.ca/map\",\n \"REACT_APP_BACKEND_USERS_API\": \"https://epd-backend-users-${ENV}.apps.silver.devops.gov.bc.ca/\",\n \"REACT_APP_BCBOX_BASE_URL\": \"https://common-object-management-service-coms-custom-e38158-${ENV}.apps.silver.devops.gov.bc.ca\",\n \"REACT_APP_BCBOX_APP_URL\": \"https://bcbox-e38158-${ENV}.apps.silver.devops.gov.bc.ca\",\n \"REACT_APP_BCBOX_BUCKET_URL\": \"/api/v1/bucket\",\n \"REACT_APP_BCBOX_FIND_USER_ENDPOINT\": \"api/v1/user?email=\",\n \"REACT_APP_BCBOX_SET_USER_PERMISSION\": \"/api/v1/permission/bucket/\",\n \"REACT_APP_BCBOX_FILE_UPLOAD_ENDPOINT\": \"api/v1/object?bucketId=\",\n \"REACT_APP_COMS_ENDPOINT\": \"https://nrs.objectstore.gov.bc.ca\",\n \"REACT_APP_COMS_BUCKET\": \"${REACT_APP_COMS_BUCKET}\",\n \"REACT_APP_COMS_ACCESS_KEY_ID\": \"${REACT_APP_COMS_ACCESS_KEY_ID}\",\n \"REACT_APP_COMS_ACCESS_KEY\": \"${REACT_APP_COMS_ACCESS_KEY}\",\n \"REACT_APP_COMS_ACCESS_REGION\": \"ca-central-1\" \n }" + config.js: "// runtime-config.js vars + + \ window[\"_env_\"] = { + + \ \"REACT_APP_NODE_ENV\": \"production\", + + \ \"REACT_APP_AUTH_AUTHORITY\": \"https://epd-keycloak-${ENV}.apps.silver.devops.gov.bc.ca/auth/realms/forms-flow-ai/\", + + \ \"REACT_APP_AUTH_CLIENT_ID\": \"${REACT_APP_AUTH_CLIENT_ID}\", + + \ \"REACT_APP_AUTH_REDIRECT_URI\": \"https://epd-frontend-${ENV}.apps.silver.devops.gov.bc.ca/dashboard\", \ + + \ \"REACT_APP_AUTH_LOGOUT_REDIRECT_URI\": \"https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi?retnow=1&returl=https://epd-keycloak-${ENV}.apps.silver.devops.gov.bc.ca/auth/realms/forms-flow-ai/protocol/openid-connect/logout?post_logout_redirect_uri=https://epd-frontend-${ENV}.apps.silver.devops.gov.bc.ca\", + + \ \"REACT_APP_AUTH_RESPONSE_TYPE\": \"code\", + + \ \"REACT_APP_AUTH_SCOPE\": \"openid profile\", + + \ \"REACT_APP_BACKEND_API\": \"https://epd-backend-gateway-${ENV}.apps.silver.devops.gov.bc.ca\", \ + + \ \"REACT_APP_AUTH_FILTER_PROTOCOL_CLAIMS\": \"true\", + + \ \"REACT_APP_AUTH_LOAD_USER_INFO\": \"true\", \ + + \ \"REACT_APP_AUTH_REVOKE_TOKENS_ON_SIGNOUT\": \"true\", + + \ \"REACT_APP_FORMSFLOW_WEB_URL\": \"https://forms-flow-web-root-config-${ENV}.apps.silver.devops.gov.bc.ca/\", + + \ \"REACT_APP_CUSTOM_MAP_URL\": \"https://epd-frontend-${ENV}.apps.silver.devops.gov.bc.ca/map\", + + \ \"REACT_APP_BACKEND_USERS_API\": \"https://epd-backend-users-${ENV}.apps.silver.devops.gov.bc.ca/\", + + \ \"REACT_APP_BCBOX_BASE_URL\": \"https://common-object-management-service-coms-custom-e38158-${ENV}.apps.silver.devops.gov.bc.ca\", + + \ \"REACT_APP_BCBOX_APP_URL\": \"https://bcbox-e38158-${ENV}.apps.silver.devops.gov.bc.ca\", + + \ \"REACT_APP_BCBOX_BUCKET_URL\": \"/api/v1/bucket\", + + \ \"REACT_APP_BCBOX_FIND_USER_ENDPOINT\": \"api/v1/user?email=\", + + \ \"REACT_APP_BCBOX_SET_USER_PERMISSION\": \"/api/v1/permission/bucket/\", + + \ \"REACT_APP_BCBOX_FILE_UPLOAD_ENDPOINT\": \"api/v1/object?bucketId=\", + + \ \"REACT_APP_COMS_ENDPOINT\": \"https://nrs.objectstore.gov.bc.ca\", + + \ \"REACT_APP_COMS_BUCKET\": \"${REACT_APP_COMS_BUCKET}\", + + \ \"REACT_APP_COMS_ACCESS_KEY_ID\": \"${REACT_APP_COMS_ACCESS_KEY_ID}\", + + \ \"REACT_APP_COMS_ACCESS_KEY\": \"${REACT_APP_COMS_ACCESS_KEY}\", + + \ \"REACT_APP_COMS_ACCESS_REGION\": \"ca-central-1\"\ + + \ }" - apiVersion: v1 kind: ImageStream metadata: @@ -74,36 +123,26 @@ objects: name: ${REGISTRY}/${PROMOTE}:${IMAGE_TAG} referencePolicy: type: Local -- apiVersion: v1 - kind: DeploymentConfig +- apiVersion: apps/v1 + kind: Deployment metadata: labels: app: ${NAME}-${COMPONENT} name: ${NAME}-${COMPONENT} spec: replicas: 1 - triggers: - - type: ConfigChange - - type: ImageChange - imageChangeParams: - automatic: true - containerNames: - - ${NAME}-${COMPONENT} - from: - kind: ImageStreamTag - name: ${NAME}-${COMPONENT}:${IMAGE_TAG} selector: - deploymentconfig: ${NAME}-${COMPONENT} + matchLabels: + app: ${NAME}-${COMPONENT} strategy: - type: Rolling + type: RollingUpdate template: metadata: labels: app: ${NAME}-${COMPONENT} - deploymentconfig: ${NAME}-${COMPONENT} spec: containers: - - image: " " + - image: "ghcr.io/${PROMOTE}:${IMAGE_TAG}" imagePullPolicy: Always name: ${NAME}-${COMPONENT} env: @@ -153,10 +192,8 @@ objects: initialDelaySeconds: 60 periodSeconds: 30 timeoutSeconds: 5 - #Added for configMap mount volumeMounts: - name: ${NAME}-config - #readOnly: true mountPath: /usr/share/nginx/html/config/ volumes: - name: ${NAME}-config @@ -175,7 +212,8 @@ objects: port: 80 targetPort: ${{CONTAINER_PORT}} selector: - deploymentconfig: ${NAME}-${COMPONENT} + matchLabels: + app: ${NAME}-${COMPONENT} - apiVersion: route.openshift.io/v1 kind: Route metadata: @@ -200,7 +238,7 @@ objects: spec: scaleTargetRef: apiVersion: apps.openshift.io/v1 - kind: DeploymentConfig + kind: Deployment name: "${NAME}-${COMPONENT}" minReplicas: ${{MIN_REPLICAS}} maxReplicas: ${{MAX_REPLICAS}} diff --git a/.github/workflows/ci-cd-openshift-dev.yaml b/.github/workflows/ci-cd-openshift-dev.yaml index 6eec3330..d197ef2d 100644 --- a/.github/workflows/ci-cd-openshift-dev.yaml +++ b/.github/workflows/ci-cd-openshift-dev.yaml @@ -5,7 +5,7 @@ on: push: branches: - 'dev' - - 'feat/srs-758-newupdate' #test11 + - 'feat/srs-758-newupdate' #test paths: - 'backend/**'