Skip to content

Commit

Permalink
Heat 227 (#10)
Browse files Browse the repository at this point in the history
 Updated pipeline, removed unwanted variable from health_ping
  • Loading branch information
KalyanaVadlamani authored Mar 26, 2024
1 parent acd04fe commit 25a4efc
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 4 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ on:
required: true
options:
- dev
- prod
version:
description: Image version
type: string
Expand All @@ -41,12 +42,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
environment: [development, production]
environment:
name: ${{ inputs.github_environment }}
steps:
- uses: actions/checkout@v3

- name: Deploy to Cloud Platform
- name: Deploy to Dev
uses: ./.github/actions/cloud-platform-deploy
with:
environment: ${{ inputs.environment }}
Expand All @@ -57,3 +60,13 @@ jobs:
namespace: ${{ secrets.DEVELOPMENT_KUBE_NAMESPACE }}
token: ${{ secrets.DEVELOPMENT_KUBE_TOKEN }}

- name: Deploy to Prod
uses: ./.github/actions/cloud-platform-deploy
with:
environment: ${{ inputs.environment }}
version: ${{ inputs.version }}
api: https://${{ secrets.PRODUCTION_KUBE_CLUSTER }}
cert: ${{ secrets.PRODUCTION_KUBE_CERT }}
cluster: ${{ secrets.PRODUCTION_KUBE_CLUSTER }}
namespace: ${{ secrets.PRODUCTION_KUBE_NAMESPACE }}
token: ${{ secrets.PRODUCTION_KUBE_TOKEN }}
25 changes: 23 additions & 2 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,42 @@ on:
branches:
- main
workflow_dispatch: # Can be triggered manually from a branch

inputs:
environment:
description: 'Deployment Environment (valid values: "development", "production")'
required: true
default: 'development'
version:
description: 'Application version to deploy'
required: true

jobs:
build:
name: Build
uses: ./.github/workflows/build.yml
with:
push: true
secrets: inherit


deploy-to-dev:
deploy_to_dev:
name: Deploy to dev
uses: ./.github/workflows/deploy.yml
needs: build
with:
github_environment: development
environment: dev
version: ${{ needs.build.outputs.version }}
secrets: inherit


deploy_to_prod:
name: Deploy to prod
uses: ./.github/workflows/deploy.yml
needs:
- deploy_to_dev # wait for the deploy_to_dev job to complete
with:
github_environment: production
environment: prod
version: ${{ github.event.inputs.version }}
secrets: inherit
11 changes: 10 additions & 1 deletion health_ping.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import socketserver

sc_api_endpoint = os.getenv("SERVICE_CATALOGUE_API_ENDPOINT")
sc_api_filter = os.getenv("SC_FILTER", '')
sc_api_token = os.getenv("SERVICE_CATALOGUE_API_KEY")
redis_host = os.getenv("REDIS_ENDPOINT")
redis_port = os.getenv("REDIS_PORT")
Expand All @@ -22,6 +21,16 @@
refresh_interval = int(os.getenv("REFRESH_INTERVAL","60"))
log_level = os.environ.get('LOG_LEVEL', 'INFO').upper()

# limit results for testing/dev
# See strapi filter syntax https://docs.strapi.io/dev-docs/api/rest/filters-locale-publication
# Example filter string = '&filters[name][$contains]=example'
# sc_api_filter = '&filters[name][$contains]=book-a-prison-visit-staff-ui'
sc_api_filter = os.getenv("SERVICE_CATALOGUE_FILTER", '')

# Example Sort filter
#SC_SORT='&sort=updatedAt:asc'


def update_sc_component(c_id, data):
try:
log.debug(f"Data to POST to strapi {data}")
Expand Down

0 comments on commit 25a4efc

Please sign in to comment.