Skip to content

Commit

Permalink
chore(ci): update security context (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
fergmac authored Oct 18, 2024
1 parent 6bc93e7 commit ebe9005
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 38 deletions.
70 changes: 35 additions & 35 deletions .github/workflows/.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,45 +19,45 @@ on:
type: string

jobs:
database:
name: Database
environment: ${{ inputs.environment }}
runs-on: ubuntu-22.04
steps:
- name: Deploy Database
uses: bcgov-nr/[email protected]
with:
oc_namespace: ${{ vars.OC_NAMESPACE }}
oc_server: ${{ vars.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
file: database/openshift.deploy.yml
overwrite: false
parameters:
-p TAG=${{ inputs.tag }} -p TARGET=${{ inputs.target }}
# database:
# name: Database
# environment: ${{ inputs.environment }}
# runs-on: ubuntu-22.04
# steps:
# - name: Deploy Database
# uses: bcgov-nr/[email protected]
# with:
# oc_namespace: ${{ vars.OC_NAMESPACE }}
# oc_server: ${{ vars.OC_SERVER }}
# oc_token: ${{ secrets.OC_TOKEN }}
# file: database/openshift.deploy.yml
# overwrite: false
# parameters:
# -p TAG=${{ inputs.tag }} -p TARGET=${{ inputs.target }}

backend:
name: Backend
needs: [database]
environment: ${{ inputs.environment }}
runs-on: ubuntu-22.04
steps:
- name: Deploy Backend
uses: bcgov-nr/[email protected]
with:
oc_namespace: ${{ vars.OC_NAMESPACE }}
oc_server: ${{ vars.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
file: backend/openshift.deploy.yml
overwrite: true
parameters:
-p TAG=${{ inputs.tag }} -p TARGET=${{ inputs.target }}
verification_path: /api/health
verification_retry_attempts: "5"
verification_retry_seconds: "15"
# backend:
# name: Backend
# needs: [database]
# environment: ${{ inputs.environment }}
# runs-on: ubuntu-22.04
# steps:
# - name: Deploy Backend
# uses: bcgov-nr/[email protected]
# with:
# oc_namespace: ${{ vars.OC_NAMESPACE }}
# oc_server: ${{ vars.OC_SERVER }}
# oc_token: ${{ secrets.OC_TOKEN }}
# file: backend/openshift.deploy.yml
# overwrite: true
# parameters:
# -p TAG=${{ inputs.tag }} -p TARGET=${{ inputs.target }}
# verification_path: /api/health
# verification_retry_attempts: "5"
# verification_retry_seconds: "15"

frontend:
name: Frontend
needs: [backend]
# needs: [backend]
environment: ${{ inputs.environment }}
runs-on: ubuntu-22.04
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
# https://github.com/bcgov/quickstart-openshift-helpers
deploys:
name: Deploy
needs: [builds]
# needs: [builds]
secrets: inherit
uses: ./.github/workflows/.deploy.yml

Expand Down
6 changes: 4 additions & 2 deletions frontend/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ objects:
containers:
- name: ${APP}-${TARGET}-${COMPONENT}
image: ghcr.io/${ORG}/${APP}/${COMPONENT}:${TAG}
# securityContext:
# runAsUser: 1011540000
# TODO: be more specific when giving permissions
securityContext:
capabilities:
add: ["NET_BIND_SERVICE"]
imagePullPolicy: Always
env:
- name: LOG_LEVEL
Expand Down

0 comments on commit ebe9005

Please sign in to comment.