Skip to content

Commit

Permalink
test migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
sakthi-aot committed Jan 24, 2025
1 parent fd18cb6 commit 324c70c
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 40 deletions.
18 changes: 8 additions & 10 deletions .github/openshift/deploy.backend-applications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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: " "
Expand Down Expand Up @@ -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:
Expand All @@ -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}}
Expand Down
96 changes: 67 additions & 29 deletions .github/openshift/deploy.frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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}}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-cd-openshift-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches:
- 'dev'
- 'feat/srs-758-newupdate' #test11
- 'feat/srs-758-newupdate' #test

paths:
- 'backend/**'
Expand Down

0 comments on commit 324c70c

Please sign in to comment.