Skip to content

Commit

Permalink
Implemented example for app service (#3)
Browse files Browse the repository at this point in the history
Implemented example for app service (#3)
  • Loading branch information
wesleycamargo authored Jul 24, 2022
1 parent 376f85f commit 2a2079d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 28 deletions.
6 changes: 3 additions & 3 deletions src/cloud/azure/appService/appService-build-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:

- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(build.artifactstagingdirectory)'
artifact: ${{ parameters.resource.runName }}
publishLocation: 'pipeline'
targetPath: $(build.artifactstagingdirectory)
artifact: ${{ parameters.resource.name }}
publishLocation: pipeline
40 changes: 19 additions & 21 deletions src/cloud/azure/appService/appService-deploy-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ parameters:
- name: environment
type: string


jobs:

- ${{ if and(eq(parameters.settings.deploy.infrastructure.enabled, 'true'), eq(parameters.resource.deploy.infrastructure.enabled, 'true')) }}:
Expand All @@ -19,7 +18,6 @@ jobs:
runOnce:
deploy:
steps:

- task: AzureResourceManagerTemplateDeployment@3
displayName: Creating App Service '${{ parameters.resource.name }}' by IaC
inputs:
Expand All @@ -29,32 +27,32 @@ jobs:
resourceGroupName: ${{ parameters.settings.azure.resourceGroup.name }}
location: ${{ parameters.settings.azure.resourceGroup.location }}
templateLocation: 'Linked artifact'
csmFile: '$(Pipeline.Workspace)/${{ parameters.resource.runName }}/infrastructure/appService.json'
csmFile: '$(Pipeline.Workspace)/${{ parameters.resource.name }}/infrastructure/appService.json'
overrideParameters: >
-servicePlanName ${{ parameters.resource.deploy.infrastructure.servicePlanName }}
-siteName ${{ parameters.resource.name }}
deploymentMode: 'Incremental'
deploymentOutputs: 'ArmOutputs'

- ${{ if and(eq(parameters.settings.deploy.application.enabled, 'true'),eq(parameters.resource.deploy.application.enabled, 'true')) }}:
- deployment:
displayName: App - Azure App Service Deployment
environment: ${{ parameters.environment }}
${{ if and(eq(parameters.settings.deploy.infrastructure.enabled, 'true'), eq(parameters.resource.deploy.infrastructure.enabled, 'true')) }}:
dependsOn: ${{ replace(parameters.resource.runName,'-','') }}iac
${{ else }}:
dependsOn: resourceGroupDeploy
strategy:
runOnce:
deploy:
steps:
# - ${{ if and(eq(parameters.settings.deploy.application.enabled, 'true'),eq(parameters.resource.deploy.application.enabled, 'true')) }}:
# - deployment:
# displayName: App - Azure App Service Deployment
# environment: ${{ parameters.environment }}
# ${{ if and(eq(parameters.settings.deploy.infrastructure.enabled, 'true'), eq(parameters.resource.deploy.infrastructure.enabled, 'true')) }}:
# dependsOn: ${{ replace(parameters.resource.runName,'-','') }}iac
# ${{ else }}:
# dependsOn: resourceGroupDeploy
# strategy:
# runOnce:
# deploy:
# steps:

- ${{ if ne( parameters.resource.type, 'appService') }}:
- task: AzureWebApp@1
inputs:
azureSubscription: ${{ parameters.settings.azure.subscription.serviceConnection }}
appName: ${{ parameters.resource.name }}
package: $(Pipeline.Workspace)/${{ parameters.resource.runName }}/**/*.zip
# - ${{ if ne( parameters.resource.type, 'appService') }}:
# - task: AzureWebApp@1
# inputs:
# azureSubscription: ${{ parameters.settings.azure.subscription.serviceConnection }}
# appName: ${{ parameters.resource.name }}
# package: $(Pipeline.Workspace)/${{ parameters.resource.runName }}/**/*.zip

# - deployment:
# displayName: Azure App Service Deployment
Expand Down
16 changes: 12 additions & 4 deletions src/cloud/azure/appService/examples/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
resources:
repositories:
- repository: ReleaseEngine
type: github
endpoint: devopsnights
name: devopsnights/AzureDevOpsReleaseEngine
ref: refs/heads/feature/appService

trigger:
branches:
include:
Expand All @@ -12,14 +20,14 @@ pool:
# name: default

extends:
template: ../../../../main.yml
template: /src/main.yml
parameters:
settings:
build:
enabled: true
deploy:
enabled: true
variablesDirectory: ./cloud/azure/appService/examples/variables
variablesDirectory: /src/cloud/azure/appService/examples/variables
infrastructure:
enabled: true
application:
Expand All @@ -37,12 +45,12 @@ extends:
# - uat
# - prd
resources:
- name: $(appServiceName)
- name: example-appService-iac
type: appService
enabled: true
deploy:
infrastructure:
enabled: true
servicePlanName: $(servicePlanName)
application:
enabled: false
enabled: false

0 comments on commit 2a2079d

Please sign in to comment.