Commit 210047c1 authored by Hema Vishnu Pola [Microsoft]'s avatar Hema Vishnu Pola [Microsoft] Committed by Daniel Scholl
Browse files

Helm Chart fixes.

parent a19fe3fd
......@@ -27,6 +27,7 @@ parameters:
mavenPomFile: 'pom.xml'
mavenPublishJUnitResults: false
mavenOptions: ''
checkoutRepo: self
stages:
......@@ -44,6 +45,8 @@ stages:
clean: all
steps:
- download: none
- checkout: ${{ parameters.checkoutRepo }}
persistCredentials: true
- task: Maven@3
displayName: 'Maven: validate'
inputs:
......
......@@ -18,6 +18,7 @@ parameters:
serviceName: ""
skipDeploy: false
hldRegPath: "providers/azure/hld-registry"
checkoutRepo: self
stages:
- ${{ each provider in parameters.providers }}:
......@@ -49,6 +50,7 @@ stages:
valuesFile: ${{ parameters.valuesFile }}
skipDeploy: ${{ parameters.skipDeploy }}
hldRegPath: ${{ parameters.hldRegPath }}
checkoutRepo: ${{ parameters.checkoutRepo }}
- template: tasks/flux-chart-wait.yml
parameters:
......
......@@ -26,6 +26,7 @@ parameters:
skipDeploy: false
skipTest: 'false'
dockerFile: ''
checkoutRepo: self
stages:
......@@ -79,3 +80,4 @@ stages:
runPythonTest: ${{ parameters.runPythonTest }}
testPythonFilePath: ${{ parameters.testPythonFilePath }}
testPythonFile: ${{ parameters.testPythonFile }}
checkoutRepo: ${{ parameters.checkoutRepo }}
......@@ -21,6 +21,10 @@ jobs:
clean: all
steps:
# Checkout to use the InfraRepo (resource repository from main pipeline) if creating the pipeline from outside of infra-azure-provisioning repo.
- checkout: InfraRepo
persistCredentials: true
condition: ne(variables['INFRA_REPO'], '')
- task: GoTool@0
displayName: 'Ensure Golang'
inputs:
......
......@@ -25,6 +25,12 @@ trigger:
exclude:
- /**/*.md
# Use this resource when creating and using a pipeline external to this repo.
# resources:
# repositories:
# - repository: InfraRepo
# type: git
# name: infra-azure-provisioning
variables:
- name: 'TF_VERSION'
......@@ -38,6 +44,9 @@ variables:
- name: 'TEST_HARNESS_DIR'
value: 'test-harness'
- group: 'Infrastructure Pipeline Variables'
# Add this variable when creating and using pipeline external to this repo.
# - name: 'INFRA_REPO'
# value: $[ resources.repositories['InfraRepo'].name ]
stages:
- template: /devops/infra-prepare-stage.yml
......
......@@ -26,6 +26,12 @@ trigger:
exclude:
- /**/*.md
# Use this resource when creating and using a pipeline external to this repo.
# resources:
# repositories:
# - repository: InfraRepo
# type: git
# name: infra-azure-provisioning
variables:
- name: 'TF_VERSION'
......@@ -39,6 +45,9 @@ variables:
- name: 'TEST_HARNESS_DIR'
value: 'test-harness'
- group: 'Infrastructure Pipeline Variables'
# Add this variable when creating and using pipeline external to this repo.
# - name: 'INFRA_REPO'
# value: $[ resources.repositories['InfraRepo'].name ]
stages:
- template: /devops/infra-prepare-stage.yml
......
......@@ -26,6 +26,12 @@ trigger:
exclude:
- /**/*.md
# Use this resource when creating and using a pipeline external to this repo.
# resources:
# repositories:
# - repository: InfraRepo
# type: git
# name: infra-azure-provisioning
variables:
- name: 'TF_VERSION'
......@@ -39,6 +45,9 @@ variables:
- name: 'TEST_HARNESS_DIR'
value: 'test-harness'
- group: 'Infrastructure Pipeline Variables'
# Add this variable when creating and using pipeline external to this repo.
# - name: 'INFRA_REPO'
# value: $[ resources.repositories['InfraRepo'].name ]
stages:
- template: /devops/infra-prepare-stage.yml
......
......@@ -21,22 +21,29 @@ parameters:
skipDeploy: false
hldRegPath: ""
generationPath: "generated"
checkoutRepo: self
steps:
# self to trigger clone of the current repo.
- checkout: self
persistCredentials: true
- checkout: FluxRepo
persistCredentials: true
- checkout: ${{ parameters.checkoutRepo }}
persistCredentials: true
- task: "HelmInstaller@1"
displayName: 'Helm Install'
inputs:
helmVersionToInstall: 3.3.0
- task: qetza.replacetokens.replacetokens-task.replacetokens@3
displayName: 'Helm Values'
displayName: 'Helm Values - Build Repo'
inputs:
targetFiles: |
$(Build.SourcesDirectory)/$(Build.Repository.Name)/${{parameters.valuesFile}} => $(Build.SourcesDirectory)/$(Build.Repository.Name)/${{parameters.chartPath}}/values.yaml
condition: eq(variables['HELM_SOURCE'], '')
- task: qetza.replacetokens.replacetokens-task.replacetokens@3
displayName: 'Helm Values - Helm Source Repo'
inputs:
targetFiles: |
$(Build.SourcesDirectory)/$(HELM_SOURCE)/${{parameters.valuesFile}} => $(Build.SourcesDirectory)/$(HELM_SOURCE)/${{parameters.chartPath}}/values.yaml
condition: ne(variables['HELM_SOURCE'], '')
- template: helm-template.yml
parameters:
serviceName: ${{parameters.serviceName}}
......
......@@ -33,6 +33,7 @@ parameters:
testPythonFilePath: ''
testPythonFile: ''
runPythonTest: ''
checkoutRepo: self
steps:
- template: detect-jar.yml
......@@ -60,6 +61,7 @@ steps:
valuesFile: ${{ parameters.valuesFile }}
hldRegPath: ${{ parameters.hldRegPath }}
skipDeploy: ${{ parameters.skipDeploy }}
checkoutRepo: ${{ parameters.checkoutRepo }}
- task: ExtractFiles@1
displayName: 'Extract ${{parameters.serviceName}} integration test suite '
......
......@@ -32,7 +32,13 @@ steps:
#!/usr/bin/env bash
set -euo pipefail
GITOPS_MANIFEST_DIRECTORY=$(Build.SourcesDirectory)/$(Build.Repository.Name)/$CHART_PATH/$GENERATION_PATH
if [[ "$(HELM_SOURCE)" != "" ]]
then
HELM_SOURCE_NAME=$(HELM_SOURCE)
else
HELM_SOURCE_NAME=$(Build.Repository.Name)
fi
GITOPS_MANIFEST_DIRECTORY=$(Build.SourcesDirectory)/$HELM_SOURCE_NAME/$CHART_PATH/$GENERATION_PATH
cd $(Build.SourcesDirectory)/$(MANIFEST_REPO)
function configure_git_profile() {
......
......@@ -28,10 +28,21 @@ steps:
script: |
#!/usr/bin/env bash
cd $(Build.SourcesDirectory)/$(Build.Repository.Name)
echo "Helm Source: $(HELM_SOURCE)"
echo "Build Trigger Repo Name: $(Build.Repository.Name)"
if [[ "$(HELM_SOURCE)" != "" ]]
then
HELM_SOURCE_NAME=$(HELM_SOURCE)
else
HELM_SOURCE_NAME=$(Build.Repository.Name)
fi
echo "Helm Source Name: $HELM_SOURCE_NAME"
cd $(Build.SourcesDirectory)/$HELM_SOURCE_NAME
mkdir $CHART_PATH/$GENERATION_PATH
cat $(Build.SourcesDirectory)/$(Build.Repository.Name)/${{parameters.chartPath}}/values.yaml
cat $(Build.SourcesDirectory)/$HELM_SOURCE_NAME/${{parameters.chartPath}}/values.yaml
echo "Extracting Manifest"
helm template $SERVICE_NAME $CHART_PATH -f $(Build.SourcesDirectory)/$(Build.Repository.Name)/${{parameters.chartPath}}/values.yaml --output-dir $CHART_PATH/$GENERATION_PATH
helm template $SERVICE_NAME $CHART_PATH -f $(Build.SourcesDirectory)/$HELM_SOURCE_NAME/${{parameters.chartPath}}/values.yaml --output-dir $CHART_PATH/$GENERATION_PATH
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment