Skip to content

Commit

Permalink
Adding in gitops tag option.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielscholl committed Feb 28, 2024
1 parent 293566c commit 1f737ac
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,9 @@ jobs:
DEPNAME='Dep${{ github.run_number }}'
PARAMS="location=$REGION applicationClientId=${{ secrets.STAMP_CLIENT_ID }} applicationClientSecret=${{ secrets.STAMP_CLIENT_SECRET }} applicationClientPrincipalOid=${{ secrets.STAMP_CLIENT_OID }}"
az stack group create -f bicep/main.bicep -g $RESOURCE_GROUP -p ${{ env.ParamFilePath }} -p $PARAMS --name $DEPNAME --deny-settings-mode None --verbose
az deployment operation group list --resource-group $RESOURCE_GROUP --name $DEPNAME
az stack group list --resource-group $RESOURCE_GROUP -o table
AKS_NAME=$(az stack group show -n $DEPNAME -g $RESOURCE_GROUP --query "properties.outputs.aksName.value" -o tsv)
AKS_NAME=$(az aks list --resource-group $RESOURCE_GROUP --query '[].name' -o tsv)
echo "AKS_NAME=$AKS_NAME" >> $GITHUB_OUTPUT
Verify:
Expand Down
21 changes: 17 additions & 4 deletions azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.25.53.49325",
"templateHash": "17914856235831198426"
"templateHash": "12262501439804272188"
}
},
"parameters": {
Expand Down Expand Up @@ -109,7 +109,8 @@
"defaultValue": {
"enable": true,
"repository": "",
"branch": ""
"branch": "",
"tag": ""
},
"metadata": {
"description": "(Optional) Software Load Override - {enable} --> true/false, {repository} --> https://github.com/azure/osdu-devloper {branch} --> branch:main"
Expand Down Expand Up @@ -19577,6 +19578,9 @@
"softwareRepository": {
"value": "[parameters('clusterSoftware').repository]"
},
"softwareTag": {
"value": "[parameters('clusterSoftware').tag]"
},
"appSettings": {
"value": [
{
Expand All @@ -19602,7 +19606,7 @@
"_generator": {
"name": "bicep",
"version": "0.25.53.49325",
"templateHash": "15582664924482987612"
"templateHash": "7367880137424033593"
}
},
"definitions": {
Expand Down Expand Up @@ -19714,6 +19718,13 @@
"description": "Software GIT Repository Branch"
}
},
"softwareTag": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Software GIT Repository Tag"
}
},
"clusterIngress": {
"type": "string",
"allowedValues": [
Expand Down Expand Up @@ -19807,6 +19818,7 @@
"name": "flux-system",
"url": "[if(equals(parameters('softwareRepository'), ''), 'https://github.com/azure/osdu-developer', parameters('softwareRepository'))]",
"branch": "[if(equals(parameters('softwareBranch'), ''), 'main', parameters('softwareBranch'))]",
"tag": "[if(equals(parameters('softwareTag'), ''), null(), parameters('softwareTag'))]",
"components": "./stamp/components",
"applications": "./stamp/applications"
},
Expand Down Expand Up @@ -23661,7 +23673,8 @@
"timeoutInSeconds": 180,
"syncIntervalInSeconds": 300,
"repositoryRef": {
"branch": "[variables('serviceLayerConfig').gitops.branch]"
"branch": "[variables('serviceLayerConfig').gitops.branch]",
"tag": "[variables('serviceLayerConfig').gitops.tag]"
}
}
},
Expand Down
2 changes: 2 additions & 0 deletions bicep/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ param clusterSoftware object = {
enable: true
repository: ''
branch: ''
tag: ''
}

// This would be a type but bugs exist for ARM Templates so is object instead.
Expand Down Expand Up @@ -386,6 +387,7 @@ module serviceBlade 'modules/blade_service.bicep' = {

softwareBranch: clusterSoftware.branch
softwareRepository: clusterSoftware.repository
softwareTag: clusterSoftware.tag

appSettings: [
{
Expand Down
3 changes: 2 additions & 1 deletion bicep/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"value": {
"enable": true,
"repository": "${SOFTWARE_REPOSITORY}",
"branch": "${SOFTWARE_BRANCH}"
"branch": "${SOFTWARE_BRANCH}",
"tag": "${SOFTWARE_TAG}"
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions bicep/modules/blade_service.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ param softwareRepository string
@description('Software GIT Repository Branch')
param softwareBranch string

@description('Software GIT Repository Tag')
param softwareTag string = ''

@allowed([
'Internal'
'External'
Expand Down Expand Up @@ -115,6 +118,7 @@ var serviceLayerConfig = {
name: 'flux-system'
url: softwareRepository == '' ? 'https://github.com/azure/osdu-developer' : softwareRepository
branch: softwareBranch == '' ? 'main' : softwareBranch
tag: softwareTag == '' ? null : softwareTag
components: './stamp/components'
applications: './stamp/applications'
}
Expand Down Expand Up @@ -544,6 +548,7 @@ module fluxConfiguration 'br/public:avm/res/kubernetes-configuration/flux-config
syncIntervalInSeconds: 300
repositoryRef: {
branch: serviceLayerConfig.gitops.branch
tag: serviceLayerConfig.gitops.tag
}
}
kustomizations: {
Expand Down

0 comments on commit 1f737ac

Please sign in to comment.