Skip to content

Commit

Permalink
ci: use gigaglobal cert for prod
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth V. Domingo committed Apr 26, 2024
1 parent 26c6643 commit 0ef4d7a
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ DEPLOY_ENV=local
DELTA_BEARER_TOKEN="$ openssl rand -base64 32"
DELTA_SHARING_HOST="delta:8890"
SECRET_KEY="$ tr -dc A-Za-z0-9 < /dev/urandom | head -c 64"
APP_DOMAIN="localhost:5000"
INGRESS_HOST="localhost:5000"
SENTRY_DSN=

STORAGE_ACCESS_KEY="get from Azure portal"
Expand Down
2 changes: 2 additions & 0 deletions azure/azure-pipelines-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ pool:
vmImage: ubuntu-latest

variables:
- name: environment
value: dev
- template: templates/variables.yaml

stages:
Expand Down
2 changes: 2 additions & 0 deletions azure/azure-pipelines-prd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ pool:
vmImage: ubuntu-latest

variables:
- name: environment
value: prd
- template: templates/variables.yaml

stages:
Expand Down
2 changes: 2 additions & 0 deletions azure/azure-pipelines-stg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ pool:
vmImage: ubuntu-latest

variables:
- name: environment
value: stg
- template: templates/variables.yaml

stages:
Expand Down
2 changes: 1 addition & 1 deletion azure/templates/create-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
ADMIN_API_KEY: "$(adminApiKey)"
ADMIN_API_SECRET: "$(adminApiSecret)"
SECRET_KEY: "$(secretKey)"
APP_DOMAIN: "$(ingressHost)"
INGRESS_HOST: "$(ingressHost)"
SENTRY_DSN: "$(sentryDsn)"
COMMIT_SHA: "$(Build.SourceVersion)"
DEPLOY_ENV: "$(deployEnv)"
21 changes: 20 additions & 1 deletion azure/templates/helm-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- task: HelmDeploy@0
displayName: Helm deploy Data Sharing proxy
condition: or(eq(variables.environment, 'dev'), eq(variables.environment, 'stg'))
inputs:
command: upgrade
chartType: FilePath
Expand All @@ -34,4 +35,22 @@ jobs:
--set ingress.enabled=true
--set ingress.hosts[0].host="$(ingressHost)"
--set ingress.hosts[0].paths[0].path="/"
--set ingress.hosts[0].paths[0].pathType=Exact
--set ingress.hosts[0].paths[0].pathType=Prefix
- task: HelmDeploy@0
displayName: Helm deploy production-config Data Sharing proxy
condition: eq(variables.environment, 'prd')
inputs:
command: upgrade
chartType: FilePath
chartPath: infra/helm/data-sharing-proxy
releaseName: data-sharing-proxy
namespace: $(kubernetesNamespace)
arguments: >
--set image.repository="$(containerRegistryName).azurecr.io/giga-data-sharing-proxy"
--set image.tag="$(Build.SourceVersion)"
--set ingress.enabled=true
--set ingress.hosts[0].host="$(ingressHost)"
--set ingress.hosts[0].paths[0].path="/"
--set ingress.hosts[0].paths[0].pathType=Prefix
--set ingress.annotations."appgw\.ingress\.kubernetes\.io/appgw-ssl-certificate"=kv-cert-gigaglobal
2 changes: 1 addition & 1 deletion data_sharing/schemas/delta_sharing.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ProfileFile(BaseModel):
1, description=ProfileFileDescriptions.share_credentials_version
)
endpoint: AnyHttpUrl = Field(
f"https://{settings.APP_DOMAIN}", description=ProfileFileDescriptions.endpoint
f"https://{settings.INGRESS_HOST}", description=ProfileFileDescriptions.endpoint
)
bearerToken: str = Field(description=ProfileFileDescriptions.bearer_token)
expirationTime: datetime | None = Field(
Expand Down
2 changes: 1 addition & 1 deletion data_sharing/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Config:
POSTGRESQL_PASSWORD: str
POSTGRESQL_DATABASE: str
DB_HOST: str
APP_DOMAIN: str
INGRESS_HOST: str
ADMIN_API_KEY: UUID4
SENTRY_DSN: str = ""
COMMIT_SHA: str = ""
Expand Down

0 comments on commit 0ef4d7a

Please sign in to comment.