Skip to content

Commit

Permalink
chore(infra): detect CD (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
sinedied authored and anfibiacreativa committed Oct 31, 2023
1 parent fc5cd8c commit ff1140f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 7 additions & 5 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ param allowedOrigin string

// Only needed for CD due to internal policies restrictions
param aliasTag string = ''
// Differentiates between automated and manual deployments
param isContinuousDeployment bool = false

var abbrs = loadJsonContent('abbreviations.json')
var resourceToken = toLower(uniqueString(subscription().id, environmentName, location))
Expand Down Expand Up @@ -371,7 +373,7 @@ module storage 'core/storage/storage-account.bicep' = {
}

// USER ROLES
module openAiRoleUser 'core/security/role.bicep' = {
module openAiRoleUser 'core/security/role.bicep' = if (!isContinuousDeployment) {
scope: openAiResourceGroup
name: 'openai-role-user'
params: {
Expand All @@ -382,7 +384,7 @@ module openAiRoleUser 'core/security/role.bicep' = {
}
}

module formRecognizerRoleUser 'core/security/role.bicep' = {
module formRecognizerRoleUser 'core/security/role.bicep' = if (!isContinuousDeployment) {
scope: formRecognizerResourceGroup
name: 'formrecognizer-role-user'
params: {
Expand All @@ -393,7 +395,7 @@ module formRecognizerRoleUser 'core/security/role.bicep' = {
}
}

module storageContribRoleUser 'core/security/role.bicep' = {
module storageContribRoleUser 'core/security/role.bicep' = if (!isContinuousDeployment) {
scope: storageResourceGroup
name: 'storage-contribrole-user'
params: {
Expand All @@ -404,7 +406,7 @@ module storageContribRoleUser 'core/security/role.bicep' = {
}
}

module searchContribRoleUser 'core/security/role.bicep' = {
module searchContribRoleUser 'core/security/role.bicep' = if (!isContinuousDeployment) {
scope: searchServiceResourceGroup
name: 'search-contrib-role-user'
params: {
Expand All @@ -415,7 +417,7 @@ module searchContribRoleUser 'core/security/role.bicep' = {
}
}

module searchSvcContribRoleUser 'core/security/role.bicep' = {
module searchSvcContribRoleUser 'core/security/role.bicep' = if (!isContinuousDeployment) {
scope: searchServiceResourceGroup
name: 'search-svccontrib-role-user'
params: {
Expand Down
3 changes: 3 additions & 0 deletions infra/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
},
"aliasTag": {
"value": "${AZURE_ALIAS}"
},
"isContinuousDeployment": {
"value": "${CI=false}"
}
}
}

0 comments on commit ff1140f

Please sign in to comment.