diff --git a/captainkube/azure-pipelines.deploy.yml b/captainkube/azure-pipelines.deploy.yml index ea1cd20b..b2dca3b6 100644 --- a/captainkube/azure-pipelines.deploy.yml +++ b/captainkube/azure-pipelines.deploy.yml @@ -33,10 +33,6 @@ variables: value: 1 - name: namespace value: charts - - name: artifact - value: "$(LOGIN_SERVER)/$(namespace)/$(containerRepository):$(chartTag)" - - name: local_chart_path - value: "$(containerRepository)-$(chartTag)" stages: - template: '../pipeline-templates/helm-deployment.yml' diff --git a/captainkube/azure-pipelines.helm.yml b/captainkube/azure-pipelines.helm.yml index 6c239fc8..1da7c272 100644 --- a/captainkube/azure-pipelines.helm.yml +++ b/captainkube/azure-pipelines.helm.yml @@ -20,59 +20,6 @@ variables: value: charts - name: HELM_EXPERIMENTAL_OCI value: 1 - - name: artifact - value: "$(LOGIN_SERVER)/$(namespace)/$(containerRepository):$(Build.BuildNumber)" stages: - - stage: Build - displayName: 'Package Helm Chart' - jobs: - - job: Helm - displayName: 'Build and Push Helm Chart' - pool: - vmImage: 'ubuntu-latest' - - steps: - - checkout: self - fetchDepth: 1 - - - task: HelmInstaller@1 - displayName: 'Initialize Helm' - inputs: - helmVersionToInstall: '3.6.0' - - - task: Bash@3 - displayName: 'Check Helm Chart' - inputs: - targetType: 'inline' - script: | - set -euo pipefail - - helm lint $(chart_path) --strict - - - task: Bash@3 - displayName: 'Save Helm Chart' - inputs: - targetType: 'inline' - script: | - set -euo pipefail - - helm chart save $(chart_path) $(artifact) - - - task: AzureCLI@2 - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) - displayName: 'Push Helm Chart' - inputs: - addSpnToEnvironment: true - azureSubscription: 'AzureOps' - scriptLocation: 'inlineScript' - scriptType: 'bash' - inlineScript: | - set -euo pipefail - - echo $servicePrincipalKey | \ - helm registry login $(LOGIN_SERVER) \ - --username $servicePrincipalId \ - --password-stdin - - helm chart push $(artifact) + - template: '../pipeline-templates/helm-package.yml' \ No newline at end of file diff --git a/nodebrady/azure-pipelines.deploy.yml b/nodebrady/azure-pipelines.deploy.yml index 861b3435..6f3604d0 100644 --- a/nodebrady/azure-pipelines.deploy.yml +++ b/nodebrady/azure-pipelines.deploy.yml @@ -33,10 +33,6 @@ variables: value: 1 - name: namespace value: charts - - name: artifact - value: "$(LOGIN_SERVER)/$(namespace)/$(containerRepository):$(chartTag)" - - name: local_chart_path - value: "$(containerRepository)-$(chartTag)" stages: - template: '../pipeline-templates/helm-deployment.yml' diff --git a/nodebrady/azure-pipelines.helm.yml b/nodebrady/azure-pipelines.helm.yml index 1ed8a1d5..bdabc844 100644 --- a/nodebrady/azure-pipelines.helm.yml +++ b/nodebrady/azure-pipelines.helm.yml @@ -20,8 +20,6 @@ variables: value: charts - name: HELM_EXPERIMENTAL_OCI value: 1 - - name: artifact - value: "$(LOGIN_SERVER)/$(namespace)/$(containerRepository):$(Build.BuildNumber)" stages: - template: '../pipeline-templates/helm-package.yml' \ No newline at end of file diff --git a/parrot/azure-pipelines.deploy.yaml b/parrot/azure-pipelines.deploy.yaml index 22fb4f68..e2a1d426 100644 --- a/parrot/azure-pipelines.deploy.yaml +++ b/parrot/azure-pipelines.deploy.yaml @@ -35,10 +35,6 @@ variables: value: 1 - name: namespace value: charts - - name: artifact - value: "$(LOGIN_SERVER)/$(namespace)/$(containerRepository):$(chartTag)" - - name: local_chart_path - value: "$(containerRepository)-$(chartTag)" stages: - template: '../pipeline-templates/helm-deployment.yml' diff --git a/parrot/azure-pipelines.helm.yaml b/parrot/azure-pipelines.helm.yaml index c867f8a0..965d3bee 100644 --- a/parrot/azure-pipelines.helm.yaml +++ b/parrot/azure-pipelines.helm.yaml @@ -18,8 +18,6 @@ variables: value: charts - name: HELM_EXPERIMENTAL_OCI value: 1 - - name: artifact - value: "$(LOGIN_SERVER)/$(namespace)/$(containerRepository):$(Build.BuildNumber)" - name: chart_path value: parrot/src/parrot/charts/parrot diff --git a/phippy/azure-pipelines.deploy.yml b/phippy/azure-pipelines.deploy.yml index 3b2fa495..12b78057 100644 --- a/phippy/azure-pipelines.deploy.yml +++ b/phippy/azure-pipelines.deploy.yml @@ -33,10 +33,6 @@ variables: value: 1 - name: namespace value: charts - - name: artifact - value: "$(LOGIN_SERVER)/$(namespace)/$(containerRepository):$(chartTag)" - - name: local_chart_path - value: "$(containerRepository)-$(chartTag)" stages: - template: '../pipeline-templates/helm-deployment.yml' diff --git a/phippy/azure-pipelines.helm.yml b/phippy/azure-pipelines.helm.yml index a540ee3e..11bf6c54 100644 --- a/phippy/azure-pipelines.helm.yml +++ b/phippy/azure-pipelines.helm.yml @@ -20,8 +20,6 @@ variables: value: charts - name: HELM_EXPERIMENTAL_OCI value: 1 - - name: artifact - value: "$(LOGIN_SERVER)/$(namespace)/$(containerRepository):$(Build.BuildNumber)" stages: - template: '../pipeline-templates/helm-package.yml' \ No newline at end of file diff --git a/pipeline-templates/helm-deployment.yml b/pipeline-templates/helm-deployment.yml index ca2d50f3..45b5da04 100644 --- a/pipeline-templates/helm-deployment.yml +++ b/pipeline-templates/helm-deployment.yml @@ -30,7 +30,7 @@ stages: - task: HelmInstaller@1 displayName: 'Pin Helm Version' inputs: - helmVersionToInstall: '3.6.0' + helmVersionToInstall: '3.7.1' - task: AzureCLI@2 displayName: 'Prepare Deployment' @@ -67,15 +67,6 @@ stages: --username $servicePrincipalId \ --password-stdin - echo "Retrieve Artifact" - helm chart pull $(artifact) - - echo "Unpack Artifact" - helm chart export "$(artifact)" --destination ./${CHART_PATH} - - echo "Sanity Check" - helm show chart ./${CHART_PATH}/$(containerRepository) - - task: HelmDeploy@0 displayName: 'Deploy Helm Chart' inputs: @@ -86,7 +77,8 @@ stages: useClusterAdmin: true namespace: 'apps' command: 'upgrade' - chartType: 'FilePath' - chartPath: './$(local_chart_path)/$(containerRepository)' + chartType: 'Name' + chartName: 'oci://$(LOGIN_SERVER)/$(namespace)/$(containerRepository)' releaseName: '$(containerRepository)' overrideValues: $(overrideValues) + arguments: '--version $(chartTag)' diff --git a/pipeline-templates/helm-package.yml b/pipeline-templates/helm-package.yml index 830814fd..5e2879d9 100644 --- a/pipeline-templates/helm-package.yml +++ b/pipeline-templates/helm-package.yml @@ -14,7 +14,7 @@ stages: - task: HelmInstaller@1 displayName: 'Pin Helm Version' inputs: - helmVersionToInstall: '3.6.0' + helmVersionToInstall: '3.7.1' - task: Bash@3 displayName: 'Check Helm Chart' @@ -26,13 +26,13 @@ stages: helm lint $(chart_path) --strict - task: Bash@3 - displayName: 'Save Helm Chart' + displayName: 'Package Helm Chart' inputs: targetType: 'inline' script: | set -euo pipefail - helm chart save $(chart_path) $(artifact) + helm package $(chart_path) --version $(Build.BuildNumber) - task: AzureCLI@2 condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) @@ -50,4 +50,4 @@ stages: --username $servicePrincipalId \ --password-stdin - helm chart push $(artifact) + helm push $(System.DefaultWorkingDirectory)/$(containerRepository)-$(Build.BuildNumber).tgz oci://$(LOGIN_SERVER)/$(namespace)