Skip to content

Commit

Permalink
Bump CLI (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
baksetercx authored Nov 14, 2024
1 parent 98c757f commit 5a5c03d
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 38 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/example-build-deploy-dockerfile-google.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ concurrency:
env:
APPLICATION_NAME: 'demo-api-go'
SYSTEM_NAME: 'core'
HELM_VALUES_PATH: '.github/test-go/deploy/values.yml'
HELM_VALUES_FILE: '.github/test-go/deploy/values.yml'
PROJECT_FILE: '.github/test-go/Dockerfile'

jobs:
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'dev'
helm-values-path: ${{ env.HELM_VALUES_PATH }}
helm-values-file: ${{ env.HELM_VALUES_FILE }}
runtime-cloud-provider: 'GKE'
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
Expand All @@ -98,7 +98,7 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'test'
helm-values-path: ${{ env.HELM_VALUES_PATH }}
helm-values-file: ${{ env.HELM_VALUES_FILE }}
runtime-cloud-provider: 'GKE'
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
Expand All @@ -125,7 +125,7 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'prod'
helm-values-path: ${{ env.HELM_VALUES_PATH }}
helm-values-file: ${{ env.HELM_VALUES_FILE }}
runtime-cloud-provider: 'GKE'
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/example-build-deploy-dockerfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ concurrency:
env:
APPLICATION_NAME: 'demo-api-go'
SYSTEM_NAME: 'core'
HELM_VALUES_PATH: '.github/test-go/deploy/values.yml'
HELM_VALUES_FILE: '.github/test-go/deploy/values.yml'
PROJECT_FILE: '.github/test-go/Dockerfile'

jobs:
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'dev'
helm-values-path: ${{ env.HELM_VALUES_PATH }}
helm-values-file: ${{ env.HELM_VALUES_FILE }}
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
slack-channel: '#team-${{ env.SYSTEM_NAME }}-alerts'
Expand All @@ -96,7 +96,7 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'test'
helm-values-path: ${{ env.HELM_VALUES_PATH }}
helm-values-file: ${{ env.HELM_VALUES_FILE }}
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
slack-channel: '#team-${{ env.SYSTEM_NAME }}-alerts'
Expand All @@ -121,7 +121,7 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'prod'
helm-values-path: ${{ env.HELM_VALUES_PATH }}
helm-values-file: ${{ env.HELM_VALUES_FILE }}
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
slack-channel: '#team-${{ env.SYSTEM_NAME }}-alerts'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/example-build-deploy-dotnet-google.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ concurrency:
env:
APPLICATION_NAME: 'demo-api'
SYSTEM_NAME: 'core'
HELM_VALUES_PATH: '.github/test/deploy/values.yml'
HELM_VALUES_FILE: '.github/test/deploy/values.yml'
PROJECT_FILE: '.github/test/src/core-demo-api.csproj'

jobs:
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'dev'
helm-values-path: ${{ env.HELM_VALUES_PATH }}
helm-values-file: ${{ env.HELM_VALUES_FILE }}
runtime-cloud-provider: 'GKE'
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
Expand All @@ -134,7 +134,7 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'test'
helm-values-path: ${{ env.HELM_VALUES_PATH }}
helm-values-file: ${{ env.HELM_VALUES_FILE }}
runtime-cloud-provider: 'GKE'
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
Expand All @@ -159,7 +159,7 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'prod'
helm-values-path: ${{ env.HELM_VALUES_PATH }}
helm-values-file: ${{ env.HELM_VALUES_FILE }}
runtime-cloud-provider: 'GKE'
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/example-build-deploy-dotnet-iss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ concurrency:
env:
APPLICATION_NAME: 'demo-api'
SYSTEM_NAME: 'iss'
HELM_VALUES_PATH: '.github/test/deploy/values.yml'
HELM_VALUES_FILE: '.github/test/deploy/values.yml'
PROJECT_FILE: '.github/test/src/core-demo-api.csproj'

jobs:
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'dev'
helm-values-path: ${{ env.HELM_VALUES_PATH }}
helm-values-file: ${{ env.HELM_VALUES_FILE }}
runtime-cloud-provider: 'ISS'
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
Expand All @@ -157,7 +157,7 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'test'
helm-values-path: ${{ env.HELM_VALUES_PATH }}
helm-values-file: ${{ env.HELM_VALUES_FILE }}
runtime-cloud-provider: 'ISS'
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
Expand All @@ -180,7 +180,7 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'prod'
helm-values-path: ${{ env.HELM_VALUES_PATH }}
helm-values-file: ${{ env.HELM_VALUES_FILE }}
runtime-cloud-provider: 'ISS'
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/example-build-deploy-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ concurrency:
env:
APPLICATION_NAME: 'demo-api'
SYSTEM_NAME: 'core'
HELM_VALUES_PATH: '.github/test/deploy/values.yml'
HELM_VALUES_FILE: '.github/test/deploy/values.yml'
PROJECT_FILE: '.github/test/src/core-demo-api.csproj'

jobs:
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'dev'
helm-values-path: ${{ env.HELM_VALUES_PATH }}
helm-values-file: ${{ env.HELM_VALUES_FILE }}
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
slack-channel: '#team-${{ env.SYSTEM_NAME }}-alerts'
Expand All @@ -132,7 +132,7 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'test'
helm-values-path: ${{ env.HELM_VALUES_PATH }}
helm-values-file: ${{ env.HELM_VALUES_FILE }}
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
slack-channel: '#team-${{ env.SYSTEM_NAME }}-alerts'
Expand All @@ -155,7 +155,7 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'prod'
helm-values-path: ${{ env.HELM_VALUES_PATH }}
helm-values-file: ${{ env.HELM_VALUES_FILE }}
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
slack-channel: '#team-${{ env.SYSTEM_NAME }}-alerts'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/example-build-deploy-go-google.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ concurrency:
env:
APPLICATION_NAME: 'demo-api-go'
SYSTEM_NAME: 'core'
HELM_VALUES_PATH: '.github/test-go/deploy/values.yml'
HELM_VALUES_FILE: '.github/test-go/deploy/values.yml'
PROJECT_FILE: '.github/test-go/go.mod'

jobs:
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'dev'
helm-values-path: ${{ env.HELM_VALUES_PATH }}
helm-values-file: ${{ env.HELM_VALUES_FILE }}
runtime-cloud-provider: 'GKE'
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
Expand All @@ -109,7 +109,7 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'test'
helm-values-path: ${{ env.HELM_VALUES_PATH }}
helm-values-file: ${{ env.HELM_VALUES_FILE }}
runtime-cloud-provider: 'GKE'
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
Expand All @@ -136,7 +136,7 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'prod'
helm-values-path: ${{ env.HELM_VALUES_PATH }}
helm-values-file: ${{ env.HELM_VALUES_FILE }}
runtime-cloud-provider: 'GKE'
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/example-build-deploy-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ concurrency:
env:
APPLICATION_NAME: 'demo-api-go'
SYSTEM_NAME: 'core'
HELM_VALUES_PATH: '.github/test-go/deploy/values.yml'
HELM_VALUES_FILE: '.github/test-go/deploy/values.yml'
PROJECT_FILE: '.github/test-go/go.mod'

jobs:
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'dev'
helm-values-path: ${{ env.HELM_VALUES_PATH }}
helm-values-file: ${{ env.HELM_VALUES_FILE }}
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
slack-channel: '#team-${{ env.SYSTEM_NAME }}-alerts'
Expand All @@ -107,7 +107,7 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'test'
helm-values-path: ${{ env.HELM_VALUES_PATH }}
helm-values-file: ${{ env.HELM_VALUES_FILE }}
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
slack-channel: '#team-${{ env.SYSTEM_NAME }}-alerts'
Expand All @@ -132,7 +132,7 @@ jobs:
name: ${{ env.APPLICATION_NAME }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'prod'
helm-values-path: ${{ env.HELM_VALUES_PATH }}
helm-values-file: ${{ env.HELM_VALUES_FILE }}
# Will post to the Slack channel of your system if the deployment fails.
# Can be commented out if you don't want this.
slack-channel: '#team-${{ env.SYSTEM_NAME }}-alerts'
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/test-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ on:
- '.github/workflows/test-actions.yml'
- '.github/test/**'
- '.github/test-go/**'
- '.github/test-docker/**'
- '**/action.yml'
- '**/requirements.txt'
- '**/*.py'
- '!README.md'
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -81,11 +80,11 @@ jobs:
"application-name": ["${{ env.APPLICATION_BASE_NAME }}", "${{ env.APPLICATION_BASE_NAME }}-go"],
"include": [
{
"helm-values-path": ".github/test/deploy/values.yml"
"helm-values-file": ".github/test/deploy/values.yml"
},
{
"application-name": "${{ env.APPLICATION_BASE_NAME }}-go",
"helm-values-path": ".github/test-go/deploy/values.yml"
"helm-values-file": ".github/test-go/deploy/values.yml"
}
]
}
Expand Down Expand Up @@ -221,7 +220,7 @@ jobs:
name: ${{ matrix.application-name }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'dev'
helm-values-path: ${{ matrix.helm-values-path }}
helm-values-file: ${{ matrix.helm-values-file }}
slack-channel: '#team-core-alerts-muted'
AZURE_CLIENT_ID: ${{ vars.AKS_CLIENT_ID }}

Expand Down Expand Up @@ -249,7 +248,7 @@ jobs:
name: ${{ matrix.application-name }}
namespace: ${{ env.SYSTEM_NAME }}
environment: 'dev'
helm-values-path: ${{ matrix.helm-values-path }}
helm-values-file: ${{ matrix.helm-values-file }}
runtime-cloud-provider: 'GKE'
GC_SERVICE_ACCOUNT: ${{ vars.GC_SERVICE_ACCOUNT }}
GC_WORKLOAD_IDENTITY_PROVIDER: ${{ vars.GC_WORKLOAD_IDENTITY_PROVIDER }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-starter-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
sed -i "s/ APPLICATION_NAME: '.*'/ APPLICATION_NAME: '<your application name here>'/g" "$new_workflow_path"
sed -i "s/ SYSTEM_NAME: '.*'/ SYSTEM_NAME: '<your system name here>'/g" "$new_workflow_path"
sed -i "s/ HELM_VALUES_PATH: '.*'/ HELM_VALUES_PATH: '.github\/deploy\/values.yml'/g" "$new_workflow_path"
sed -i "s/ HELM_VALUES_FILE: '.*'/ HELM_VALUES_FILE: '.github\/deploy\/values.yml'/g" "$new_workflow_path"
sed -i "s/ PROJECT_FILE: '.*'/ PROJECT_FILE: '<your project file path here>'/g" "$new_workflow_path"
sed -i "s/# pull_request:/ pull_request:/g" "$new_workflow_path"
sed -i 's/# branches:/ branches:/g' "$new_workflow_path"
Expand Down
2 changes: 1 addition & 1 deletion build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ runs:
- name: Install 3lv CLI
uses: 3lvia/cli/setup@trunk
with:
version: '0.16.0' # TODO: remove this (which will get latest version) when 3lv CLI is stable
version: '0.17.2' # TODO: remove this (which will get latest version) when 3lv CLI is stable

- name: Handle deprecated inputs
shell: bash
Expand Down
12 changes: 10 additions & 2 deletions deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ inputs:
description: 'Environment to deploy to.'
required: true
helm-values-path:
description: 'Path to Helm values file, relative to the root of the repository.'
required: false
deprecationMessage: |
Please use `helm-values-file` instead, which is a drop-in replacement. `helm-values-path` will be removed in the future.
helm-values-file:
description: 'Path to Helm values file, relative to the root of the repository.'
required: false
default: '.github/deploy/values.yml'
Expand Down Expand Up @@ -135,14 +140,14 @@ runs:
- name: Install 3lv CLI
uses: 3lvia/cli/setup@trunk
with:
version: '0.16.0' # TODO: remove this (which will get latest version) when 3lv CLI is stable
version: '0.17.2' # TODO: remove this (which will get latest version) when 3lv CLI is stable

- name: Deploy
shell: bash
run: |
3lv deploy \
--system-name '${{ inputs.namespace }}' \
--helm-values-file '${{ inputs.helm-values-path }}' \
--helm-values-file "$HELM_VALUES_FILE" \
--environment '${{ inputs.environment }}' \
--workload-type '${{ inputs.workload-type }}' \
--runtime-cloud-provider '${{ inputs.runtime-cloud-provider }}' \
Expand All @@ -153,6 +158,9 @@ runs:
--run-id '${{ github.run_id }}' \
'${{ inputs.name }}'
env:
HELM_VALUES_FILE: ${{ inputs.helm-values-path == '' && inputs.helm-values-file || inputs.helm-values-path }}
# Pass optional inputs as environment variables, since they can be empty.
# The CLI does not accept empty strings passed to the flags, e.g. `--gke-project-id ''` will cause an error.
3LV_AZURE_TENANT_ID: ${{ inputs.AZURE_TENANT_ID }}
3LV_AZURE_CLIENT_ID: ${{ inputs.AZURE_CLIENT_ID }}
3LV_AZURE_FEDERATED_TOKEN: ${{ steps.get-federated-token.outputs.token }}
Expand Down

0 comments on commit 5a5c03d

Please sign in to comment.