-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added stage/job/step YAML templates for YAML release pipelines +semve…
…r: minor (#144) * initial building blocks * Changed path for create resource group task * Removed path for create resource group * added config schema path reference * removed environment in deployment name * Update app-deploy.yml * Update app-deploy.yml * Testing App name for parallel jobs in a stage * added app-deploy.yml step template * testing depends on * lets go * using parameters json * clean workspace when deploying arm templte * added generate parameters file to arm-deploy.yml template * use environment variables test * environment test * inline * test resource repositores * remove repository resource * fixed * checkout tests * removed * import script attempt without checkout * subscription level arm template deployment * add AzureServiceConnection parameter * parameter name change * parameter changeees * tests * hardcode attempt * revert the hard code * remove uneeded download github releas task * re-added checkout * added placeholder template * placeholder * added github release creation in yaml * added versioning section in readme * remove master condition for testing * added prerelease * hard coded tag value for test * test * try another service connection * temp service connection * undid changes - confirmed service connection error * parameterized location * add versioning stage * removed pre release * updated display name for arm template deployment Co-authored-by: Mohamad Adam <[email protected]>
- Loading branch information
1 parent
4e2bac5
commit 153d422
Showing
11 changed files
with
243 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mode: Mainline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# placeholder file - delete this file when adding first template to this folder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# placeholder file - delete this file when adding first template to this folder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
steps: | ||
- task: DotNetCoreCLI@2 | ||
displayName: Restore | ||
inputs: | ||
command: restore | ||
projects: 'src/**/*.csproj' | ||
noCache: true | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: Build | ||
inputs: | ||
projects: 'src/**/*.csproj' | ||
arguments: '--configuration $(buildConfiguration) --no-restore' | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: 'Unit Tests' | ||
inputs: | ||
command: test | ||
projects: '**/*.UnitTests.csproj' | ||
arguments: '--configuration $(buildConfiguration) --no-build' | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: 'Acceptance Tests' | ||
inputs: | ||
command: test | ||
projects: '**/*.AcceptanceTests.csproj' | ||
arguments: '--configuration $(buildConfiguration) --no-build' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
steps: | ||
- task: esfadevops.DependencyCheck.custom-dependency-check.DependencyCheck@2 | ||
displayName: 'Dependency Check' | ||
inputs: | ||
enableVulnerabilityFilesMaintenance: false | ||
logAnalyticsWorkspaceId: '$(LogAnalyticsWorkspaceId)' | ||
logAnalyticsWorkspaceKey: '$(LogAnalyticsWorkspaceKey)' | ||
enableSelfHostedVulnerabilityFiles: true | ||
readStorageAccountContainerSasUri: '$(DependencyCheckSasUri)' | ||
excludedScanPathPatterns: '$(DependencyCheckExcludedScanPathPatterns)' | ||
severityThreshold: '$(DependencyCheckSeverityThreshold)' | ||
dependencyCheckDashboardUrl: '$(DependencyCheckDashboardUrl)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
parameters: | ||
ServiceConnection: '' | ||
SubscriptionId: '' | ||
Location: '' | ||
Environment: '' | ||
TemplatePath: '' | ||
ParametersPath: '' | ||
ConfigSchemaPath: '' | ||
TemplateSecrets: {} | ||
|
||
jobs: | ||
- deployment: DeployInfrastructure | ||
pool: | ||
name: DAS - Continuous Deployment | ||
environment: ${{ parameters.Environment }} | ||
workspace: | ||
clean: all | ||
strategy: | ||
runOnce: | ||
deploy: | ||
steps: | ||
- checkout: das-platform-automation | ||
- task: PowerShell@2 | ||
displayName: Generate Parameters File | ||
inputs: | ||
filePath: Infrastructure-Scripts/New-ParametersFile.ps1 | ||
arguments: > | ||
-TemplateFilePath ${{ parameters.TemplatePath }} | ||
-ParametersFilePath ${{ parameters.ParametersPath }} | ||
pwsh: true | ||
env: ${{ parameters.TemplateSecrets }} | ||
|
||
- task: AzureResourceManagerTemplateDeployment@3 | ||
displayName: Azure Subscription Deployment - Create/Tag resource group and deploy resources | ||
inputs: | ||
deploymentScope: Subscription | ||
ConnectedServiceName: ${{ parameters.ServiceConnection }} | ||
subscriptionId: ${{ parameters.SubscriptionId }} | ||
location: ${{ parameters.Location }} | ||
csmFile: ${{ parameters.TemplatePath }} | ||
csmParametersFile: ${{ parameters.ParametersPath }} | ||
deploymentOutputs: ARMOutputs | ||
|
||
- task: esfadevops.ARMTemplateOutputs.custom-build-task.ARMTemplateOutputs@0 | ||
displayName: Convert ARM Template Outputs to Variables | ||
inputs: | ||
ARMOutputs: $(ARMOutputs) | ||
|
||
- template: ../step/generate-config.yml | ||
parameters: | ||
ServiceConnection: ${{ parameters.ServiceConnection }} | ||
SourcePath: ${{ parameters.ConfigSchemaPath }} | ||
TargetFileName: '*.schema.json' | ||
TableName: Configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# placeholder file - delete this file when adding first template to this folder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
parameters: | ||
ServiceConnection: '' | ||
AppServiceName: '' | ||
DeploymentPackagePath: '' | ||
|
||
steps: | ||
- task: AzureRmWebAppDeployment@3 | ||
displayName: Deploy Staging Slot - ${{ parameters.AppServiceName }} | ||
inputs: | ||
azureSubscription: ${{ parameters.ServiceConnection }} | ||
appType: webApp | ||
WebAppName: ${{ parameters.AppServiceName }} | ||
DeployToSlotFlag: true | ||
ResourceGroupName: $(ResourceGroupName) | ||
SlotName: staging | ||
Package: ${{ parameters.DeploymentPackagePath }} | ||
UseWebDeploy: true | ||
RemoveAdditionalFilesFlag: true | ||
|
||
- task: AzureAppServiceManage@0 | ||
displayName: Start Staging Slot - ${{ parameters.AppServiceName }} | ||
inputs: | ||
azureSubscription: ${{ parameters.ServiceConnection }} | ||
Action: Start Azure App Service | ||
WebAppName: ${{ parameters.AppServiceName }} | ||
ResourceGroupName: $(ResourceGroupName) | ||
SpecifySlotOrASE: true | ||
Slot: staging | ||
|
||
- task: AzureAppServiceManage@0 | ||
displayName: Start Swap Slots - ${{ parameters.AppServiceName }} | ||
inputs: | ||
azureSubscription: ${{ parameters.ServiceConnection }} | ||
Action: Start Swap With Preview | ||
WebAppName: ${{ parameters.AppServiceName }} | ||
ResourceGroupName: $(ResourceGroupName) | ||
SourceSlot: staging | ||
|
||
- task: AzureAppServiceManage@0 | ||
displayName: Complete Swap Slot | ||
inputs: | ||
azureSubscription: ${{ parameters.ServiceConnection }} | ||
Action: Complete Swap | ||
WebAppName: ${{ parameters.AppServiceName }} | ||
ResourceGroupName: $(ResourceGroupName) | ||
SourceSlot: staging | ||
|
||
- task: AzureAppServiceManage@0 | ||
displayName: Stop Staging Slot - ${{ parameters.AppServiceName }} | ||
condition: always() | ||
inputs: | ||
azureSubscription: ${{ parameters.ServiceConnection }} | ||
Action: Stop Azure App Service | ||
WebAppName: ${{ parameters.AppServiceName }} | ||
SpecifySlotOrASE: true | ||
ResourceGroupName: $(ResourceGroupName) | ||
Slot: staging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
parameters: | ||
ServiceConnection: '' | ||
SourcePath: '' | ||
TargetFileName: '' | ||
TableName: '' | ||
|
||
steps: | ||
- task: esfadevops.GenerateEnvironmentConfiguration.custom-build-task.GenerateEnvironmentConfiguration@3 | ||
displayName: 'Generate Configuration' | ||
inputs: | ||
ServiceConnectionName: ${{ parameters.ServiceConnection }} | ||
SourcePath: ${{ parameters.SourcePath }} | ||
TargetFilename: ${{ parameters.TargetFileName }} | ||
StorageAccountName: '$(ConfigurationStorageAccountName)' | ||
TableName: ${{ parameters.TableName }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
trigger: | ||
batch: true | ||
branches: | ||
include: | ||
- "master" | ||
|
||
pr: none | ||
|
||
stages: | ||
- stage: Versioning | ||
dependsOn: [] | ||
jobs: | ||
- job: GitVersion | ||
displayName: Version | ||
pool: | ||
name: DAS - Continuous Integration | ||
steps: | ||
- task: gittools.gitversion-preview.gitversion-task.GitVersion@5 | ||
displayName: GitVersion | ||
inputs: | ||
configFilePath: GitVersion.yml | ||
|
||
- stage: Release | ||
dependsOn: Versioning | ||
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master') | ||
jobs: | ||
- deployment: GitHubRelease | ||
displayName: Create Release in GitHub | ||
pool: | ||
name: DAS - Continuous Deployment | ||
environment: GitHub | ||
strategy: | ||
runOnce: | ||
deploy: | ||
steps: | ||
- task: GitHubRelease@0 | ||
inputs: | ||
gitHubConnection: SFA | ||
repositoryName: $(Build.Repository.Name) | ||
action: create | ||
target: $(Build.SourceVersion) | ||
tagSource: manual | ||
tag: $(Build.BuildNumber) | ||
addChangeLog: true | ||
assets: | | ||
$(Build.ArtifactStagingDirectory)/**/*.yml | ||
$(Build.ArtifactStagingDirectory)/**/*.json |