Skip to content

Commit

Permalink
Merge branch 'main' into feature/#4155-Disbursement_Receipt_Process_F…
Browse files Browse the repository at this point in the history
…ail_Expectations
  • Loading branch information
guru-aot committed Jan 14, 2025
2 parents 0ebc6a8 + 7a1e351 commit 6a72970
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 63 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/env-setup-sysdig-teams.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Env Setup - Update Sysdig Team in Openshift
run-name: Env Setup - Update Sysdig Team in Openshift using ${{ github.ref_name }}

concurrency: update-sysdig-team

on:
workflow_dispatch:

jobs:
update-sysdig-team:
name: Update Sysdig Team
runs-on: ubuntu-latest
steps:
- name: Checkout Target Branch
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Install CLI tools from OpenShift Mirror
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4"
- name: Log in to OpenShift
run: |
oc login --token=${{ secrets.SA_TOKEN }} --server=${{ vars.OPENSHIFT_CLUSTER_URL }}
- name: Delete Redis
working-directory: "./devops/"
run: |
make update-sysdig-team
16 changes: 12 additions & 4 deletions devops/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ deploy-api:
-p TLS_CA_CERTIFICATE=$(TLS_CA_CERTIFICATE) \
-p ALLOW_BETA_USERS_ONLY=$(ALLOW_BETA_USERS_ONLY) \
| oc -n $(NAMESPACE) apply -f -
$(call rollout_and_wait,dc/$(API))
$(call rollout_and_wait,deployment/$(API))

deploy-workers:
test -n "$(NAMESPACE)"
Expand All @@ -393,7 +393,7 @@ deploy-workers:
-p BYPASS_CRA_INCOME_VERIFICATION=$(BYPASS_CRA_INCOME_VERIFICATION) \
-p DISABLE_ORM_CACHE=$(DISABLE_ORM_CACHE) \
| oc -n $(NAMESPACE) apply -f -
$(call rollout_and_wait,dc/$(WORKERS))
$(call rollout_and_wait,deployment/$(WORKERS))

deploy-queue-consumers:
test -n "$(NAMESPACE)"
Expand Down Expand Up @@ -426,7 +426,7 @@ deploy-queue-consumers:
-p TLS_KEY=$(TLS_KEY) \
-p TLS_CA_CERTIFICATE=$(TLS_CA_CERTIFICATE) \
| oc -n $(NAMESPACE) apply -f -
$(call rollout_and_wait,dc/$(QUEUE_CONSUMERS))
$(call rollout_and_wait,deployment/$(QUEUE_CONSUMERS))

deploy-load-test-gateway:
test -n "$(NAMESPACE)"
Expand All @@ -453,7 +453,7 @@ deploy-load-test-gateway:
-p TLS_KEY=$(TLS_KEY) \
-p TLS_CA_CERTIFICATE=$(TLS_CA_CERTIFICATE) \
| oc -n $(NAMESPACE) apply -f -
$(call rollout_and_wait,dc/$(LOAD_TEST_GATEWAY))
$(call rollout_and_wait,deployment/$(LOAD_TEST_GATEWAY))

deploy-web:
test -n "$(NAMESPACE)"
Expand Down Expand Up @@ -517,3 +517,11 @@ deploy-forms:
delete-redis:
@echo "+\n++ Removing redis and resources on $(NAMESPACE)\n+"
@oc delete -n $(NAMESPACE) all,rc,svc,dc,route,pvc,secret,configmap,sa -l app=redis

update-sysdig-team:
@echo "Updating Sysdig Team for license plate 0c27fb.\n"
@oc project 0c27fb-tools
@oc process -f openshift/sysdig-team.yml -p LICENSE_PLATE=0c27fb | oc apply -f -
@echo "Updating Sysdig Team for license plate a6ef19.\n"
@oc project a6ef19-tools
@oc process -f openshift/sysdig-team.yml -p LICENSE_PLATE=a6ef19 | oc apply -f -
21 changes: 12 additions & 9 deletions devops/openshift/api-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,24 @@ labels:
project: ${PROJECT}
service: ${SERVICE_NAME}
objects:
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
- apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: ${NAME}
name: ${NAME}
spec:
replicas: "${{REPLICAS}}"
revisionHistoryLimit: 10
selector:
deploymentconfig: ${NAME}
matchLabels:
app: ${NAME}
strategy:
type: Rolling
type: RollingUpdate
template:
metadata:
labels:
deploymentconfig: ${NAME}
app: ${NAME}
spec:
containers:
- env:
Expand Down Expand Up @@ -239,7 +242,7 @@ objects:
port: 80
targetPort: ${{PORT}}
selector:
deploymentconfig: ${NAME}
app: ${NAME}
type: ClusterIP
- apiVersion: route.openshift.io/v1
kind: Route
Expand Down Expand Up @@ -341,8 +344,8 @@ objects:
name: ${NAME}-hpa
spec:
scaleTargetRef:
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
name: ${NAME}
minReplicas: "${{REPLICAS}}"
maxReplicas: 10
Expand All @@ -366,7 +369,7 @@ objects:
spec:
selector:
matchLabels:
deploymentconfig: ${NAME}
app: ${NAME}
maxUnavailable: 1
parameters:
- name: NAME
Expand Down
15 changes: 9 additions & 6 deletions devops/openshift/load-test-gateway-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,24 @@ labels:
project: ${PROJECT}
service: ${SERVICE_NAME}
objects:
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
- apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: ${NAME}
name: ${NAME}
spec:
replicas: "${{REPLICAS}}"
revisionHistoryLimit: 10
selector:
deploymentconfig: ${NAME}
matchLabels:
app: ${NAME}
strategy:
type: Rolling
type: RollingUpdate
template:
metadata:
labels:
deploymentconfig: ${NAME}
app: ${NAME}
spec:
containers:
- env:
Expand Down Expand Up @@ -98,7 +101,7 @@ objects:
port: 80
targetPort: ${{PORT}}
selector:
deploymentconfig: ${NAME}
app: ${NAME}
type: ClusterIP
- apiVersion: route.openshift.io/v1
kind: Route
Expand Down
21 changes: 12 additions & 9 deletions devops/openshift/queue-consumers-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,28 @@ labels:
project: ${PROJECT}
service: ${SERVICE_NAME}
objects:
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
- apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: ${NAME}
name: ${NAME}
spec:
replicas: "${{REPLICAS}}"
revisionHistoryLimit: 10
selector:
deploymentconfig: ${NAME}
matchLabels:
app: ${NAME}
strategy:
type: Rolling
type: RollingUpdate
template:
metadata:
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: ${PORT}
prometheus.io/path: /metrics
labels:
deploymentconfig: ${NAME}
app: ${NAME}
spec:
containers:
- env:
Expand Down Expand Up @@ -293,7 +296,7 @@ objects:
port: 80
targetPort: ${{PORT}}
selector:
deploymentconfig: ${NAME}
app: ${NAME}
type: ClusterIP
- apiVersion: route.openshift.io/v1
kind: Route
Expand Down Expand Up @@ -331,8 +334,8 @@ objects:
name: ${NAME}-hpa
spec:
scaleTargetRef:
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
name: ${NAME}
minReplicas: "${{REPLICAS}}"
maxReplicas: 10
Expand All @@ -356,7 +359,7 @@ objects:
spec:
selector:
matchLabels:
deploymentconfig: ${NAME}
app: ${NAME}
maxUnavailable: 1
parameters:
- name: NAME
Expand Down
66 changes: 39 additions & 27 deletions devops/openshift/sysdig-team.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
apiVersion: ops.gov.bc.ca/v1alpha1
kind: SysdigTeam
metadata:
name: 0c27fb-sysdigteam
namespace: 0c27fb-tools
spec:
team:
description: The Sysdig Team for the OpenShift Project Set SIMS
users:
- name: [email protected]
role: ROLE_TEAM_EDIT
- name: [email protected]
role: ROLE_TEAM_EDIT
- name: [email protected]
role: ROLE_TEAM_EDIT
- name: [email protected]
role: ROLE_TEAM_EDIT
- name: [email protected]
role: ROLE_TEAM_EDIT
- name: [email protected]
role: ROLE_TEAM_EDIT
- name: [email protected]
role: ROLE_TEAM_EDIT
- name: [email protected]
role: ROLE_TEAM_STANDARD
- name: [email protected]
role: ROLE_TEAM_STANDARD
apiVersion: template.openshift.io/v1
kind: Template
objects:
- apiVersion: ops.gov.bc.ca/v1alpha1
kind: SysdigTeam
metadata:
name: ${LICENSE_PLATE}-sysdigteam
namespace: ${LICENSE_PLATE}-tools
spec:
team:
description: The Sysdig Team for the OpenShift Project Set SIMS
users:
- name: [email protected]
role: ROLE_TEAM_EDIT
- name: [email protected]
role: ROLE_TEAM_EDIT
- name: [email protected]
role: ROLE_TEAM_EDIT
- name: [email protected]
role: ROLE_TEAM_EDIT
- name: [email protected]
role: ROLE_TEAM_STANDARD
- name: [email protected]
role: ROLE_TEAM_EDIT
- name: [email protected]
role: ROLE_TEAM_EDIT
- name: [email protected]
role: ROLE_TEAM_EDIT
- name: [email protected]
role: ROLE_TEAM_EDIT
- name: [email protected]
role: ROLE_TEAM_STANDARD
- name: [email protected]
role: ROLE_TEAM_STANDARD
parameters:
- name: LICENSE_PLATE
description: |
License plate to apply the template.
required: true
19 changes: 11 additions & 8 deletions devops/openshift/workers-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,24 @@ labels:
project: ${PROJECT}
service: ${SERVICE_NAME}
objects:
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
- apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: ${NAME}
name: ${NAME}
spec:
replicas: "${{REPLICAS}}"
revisionHistoryLimit: 10
selector:
deploymentconfig: ${NAME}
matchLabels:
app: ${NAME}
strategy:
type: Rolling
type: RollingUpdate
template:
metadata:
labels:
deploymentconfig: ${NAME}
app: ${NAME}
spec:
containers:
- env:
Expand Down Expand Up @@ -112,8 +115,8 @@ objects:
name: ${NAME}-hpa
spec:
scaleTargetRef:
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
name: ${NAME}
minReplicas: "${{REPLICAS}}"
maxReplicas: 10
Expand All @@ -137,7 +140,7 @@ objects:
spec:
selector:
matchLabels:
deploymentconfig: ${NAME}
app: ${NAME}
maxUnavailable: 1
parameters:
- name: NAME
Expand Down

0 comments on commit 6a72970

Please sign in to comment.