Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/am-user-platform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: AM User Platform Publish

on:
push:
branches: ["main", "develop", "test/**", "feature/**", "hotfix/**", "fix/**"]
paths:
- "am-user-platform/**"
- "libraries/**"
- "requirements.txt"
- "requirements-dev.txt"
- ".dockerignore"
- "docker/**"
pull_request:
branches: ["main", "develop", "test/**", "feature/**", "hotfix/**", "fix/**"]
paths:
- "am-user-platform/**"
- "libraries/**"
- "requirements.txt"
- "requirements-dev.txt"
- ".dockerignore"
- "docker/**"
workflow_dispatch:

jobs:
publish:
name: Publish AM User Platform
permissions:
contents: read
packages: write
uses: AM-Portfolio/am-pipelines/.github/workflows/central-build-publish.yml@main
with:
language: "python"
working_directory: "am-user-platform"
image_name: "am-user-platform"
build_context: ".."
preprod_namespace: "am-apps-preprod"
prod_namespace: "am-apps-prod"
deploy_dev: true
deploy_prod: true
secrets: inherit
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- "am-identity/**"
- "am-subscription/**"
- "am-notification/**"
- "am-user-platform/**"
- "libraries/**"
- "requirements*.txt"
pull_request:
Expand All @@ -15,6 +16,7 @@ on:
- "am-identity/**"
- "am-subscription/**"
- "am-notification/**"
- "am-user-platform/**"
- "libraries/**"
- "requirements*.txt"

Expand All @@ -37,10 +39,10 @@ jobs:
pip install ./libraries/am-platform-common ./libraries/am-platform-security

- name: Run Ruff Linter
run: ruff check am-identity am-subscription am-notification libraries
run: ruff check am-identity am-subscription am-notification am-user-platform libraries

- name: Run Black Code Formatter Check
run: black --check am-identity am-subscription am-notification libraries
run: black --check am-identity am-subscription am-notification am-user-platform libraries

- name: Run Unit Tests
env:
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/deploy-am-user-platform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Manual Deploy (AM User Platform)

on:
workflow_dispatch:
inputs:
image_tag:
description: "Select Image Tag"
required: true
default: "latest"
type: choice
options:
- latest
- custom
custom_tag:
description: "If 'custom' selected, enter tag here"
required: false
type: string
environment:
description: "Target Environment"
required: true
default: "preprod"
type: choice
options:
- preprod
- prod

jobs:
deploy:
name: Deploy AM User Platform to ${{ github.event.inputs.environment }}
uses: AM-Portfolio/am-pipelines/.github/workflows/central-deploy.yml@main
with:
service_name: "am-user-platform"
working_directory: "am-user-platform"
language: "python"
environment: ${{ github.event.inputs.environment }}
image_tag: ${{ github.event.inputs.image_tag == 'custom' && github.event.inputs.custom_tag || github.event.inputs.image_tag }}
namespace: ${{ github.event.inputs.environment == 'prod' && 'am-apps-prod' || 'am-apps-preprod' }}
secrets: inherit
3 changes: 2 additions & 1 deletion am-subscription/.am.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ image: ghcr.io/am-portfolio/am-subscription
runtime: python
language: python
dockerfile: Dockerfile
context: .
# Dockerfile COPYs libraries/ + am-subscription/ — build from am-platform root
context: ..
github:
repo: AM-Portfolio/am-platform
deploy_workflow: central-build-publish.yml
Expand Down
1 change: 1 addition & 0 deletions am-subscription/am_subscription/api/internal_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

INTERNAL_CLIENTS = {
"am-gateway-client",
"am-fin-agent-service",
"am-portfolio-service",
"am-market-service",
"am-market-data-service",
Expand Down
1 change: 1 addition & 0 deletions am-subscription/am_subscription/schemas/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class PlanLimitsDTO(BaseDTO):
portfolios: int = 0
ai_portfolio_summaries: int = 0
api_calls: int = 0
ai_chat_tokens: int = 0


class PlanDTO(BaseDTO):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"portfolio.create": "portfolios",
"ai.summary": "ai_portfolio_summaries",
"api.call": "api_calls",
"ai.chat": "ai_chat_tokens",
}


Expand Down
Loading
Loading