Skip to content
Closed
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
16 changes: 16 additions & 0 deletions .github/workflows/component-service-profile-kotlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ on:
default: 'service-profile.yml'
type: string
description: 'File name for the service profile in the `templates` directory'
service-profile-name:
required: false
type: string
default: ''
description: 'ServiceProfile metadata.name (<service>.<namespace>.svc.cluster.local). Set when the Kubernetes Service is not named <service-identifier>-<stage>; empty keeps that default.'
openapi-max-workers:
required: false
type: string
Expand Down Expand Up @@ -112,6 +117,8 @@ jobs:
fi
- name: Generate service profile
shell: bash
env:
SERVICE_PROFILE_NAME: ${{ inputs.service-profile-name }}
run: |
# Find the generated spec
YML_FILE=$(find . -type f -name '*.yml' \
Expand All @@ -138,6 +145,10 @@ jobs:
{"condition": {"method": "HEAD"}, "name": "HEAD [Default]"},
{"condition": {"method": "OPTIONS"}, "name": "OPTIONS [Default]"}
]' > service-profile.yml

if [ -n "$SERVICE_PROFILE_NAME" ]; then
yq -i '.metadata.name = strenv(SERVICE_PROFILE_NAME)' service-profile.yml
fi
- name: Check out manifest repository
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
Expand All @@ -146,6 +157,8 @@ jobs:
token: ${{ secrets.MANIFEST_REPO_PAT }}
- name: Update or create manifest file
shell: bash
env:
SERVICE_PROFILE_NAME: ${{ inputs.service-profile-name }}
run: |
TEMPLATES_PATH="./manifests/apps/${{ inputs.service-identifier }}/${{ inputs.stage }}/app/templates"

Expand All @@ -155,6 +168,9 @@ jobs:
# Only update the routes part of the service profile if it already exists
if [[ -f "$SERVICE_PROFILE_FILE" ]]; then
yq -i '.spec.routes = load("service-profile.yml").spec.routes' $SERVICE_PROFILE_FILE
if [ -n "$SERVICE_PROFILE_NAME" ]; then
yq -i '.metadata.name = strenv(SERVICE_PROFILE_NAME)' $SERVICE_PROFILE_FILE
fi
else
cp service-profile.yml $SERVICE_PROFILE_FILE
fi
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/deploy-kotlin-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ on:
type: boolean
default: true
description: 'Use generated openapi spec to generate linkerd service profile and update the service helm chart'
service-profile-name:
required: false
type: string
default: ''
description: 'ServiceProfile metadata.name (<service>.<namespace>.svc.cluster.local). Set when the Kubernetes Service is not named <service-identifier>-<stage>; empty keeps that default.'
openapi-max-workers:
required: false
type: string
Expand Down Expand Up @@ -323,6 +328,7 @@ jobs:
gradle-module: ${{ inputs.gradle-module }}
java-version: ${{ inputs.java-version }}
openapi-max-workers: ${{ inputs.openapi-max-workers }}
service-profile-name: ${{ inputs.service-profile-name }}
use-arc-runners: ${{ (inputs.use-arc-runners && github.event.repository.private) }}
secrets:
GHL_USERNAME: ${{ secrets.GHL_USERNAME }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/deploy-kotlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ on:
type: boolean
default: true
description: 'Use generated openapi spec to generate linkerd service profile and update the service helm chart'
service-profile-name:
required: false
type: string
default: ''
description: 'ServiceProfile metadata.name (<service>.<namespace>.svc.cluster.local). Set when the Kubernetes Service is not named <service-identifier>-<stage>; empty keeps that default.'
openapi-max-workers:
required: false
type: string
Expand Down Expand Up @@ -308,6 +313,7 @@ jobs:
gradle-module: ${{ inputs.gradle-module }}
java-version: ${{ inputs.java-version }}
openapi-max-workers: ${{ inputs.openapi-max-workers }}
service-profile-name: ${{ inputs.service-profile-name }}
use-arc-runners: ${{ (inputs.use-arc-runners && github.event.repository.private) }}
secrets:
GHL_USERNAME: ${{ secrets.GHL_USERNAME }}
Expand Down
1 change: 1 addition & 0 deletions docs/workflow-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ jobs:
| `ecr-repository-name` | No | - | Override ECR repository name |
| `run-tests` | No | true | Run tests before deployment |
| `update-service-profile` | No | true | Generate linkerd service profile from OpenAPI spec |
| `service-profile-name` | No | `{service-identifier}-{stage}.{service-identifier}-{stage}.svc.cluster.local` | ServiceProfile name; set when the Service is named differently |
| `helm-values-path` | No | `helm/{service-identifier}/{stage}/app` | Path to helm values directory in service repo |
| `repository-name` | No | `service-{service-identifier}` | Service repository name override |
| `argocd-server` | No | - | ArgoCD server URL (e.g., argocd.monta.app) |
Expand Down