Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup .NET 3.1.x
uses: actions/setup-dotnet@v1
- name: Setup .NET 10.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: 3.1.x

- name: Setup .NET 6.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.x.x
dotnet-version: 10.0.x

- name: Restore dependencies
run: dotnet restore src/service/Microsoft.FeatureFlighting.sln
Expand Down
188 changes: 188 additions & 0 deletions assets/pipeline/cd-feature-flights-management-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
resources:
repositories:
- repository: FeatureFlightingGithub
type: github
endpoint: github.com
name: microsoft/FeatureFlightingManagement
trigger:
- none
- repository: FxpTools
type: git
name: CE-FS-FExP-FxpTools

variables:
BuildPlatform: 'any cpu'
BuildConfiguration: 'release'
stages:
- stage: Build
jobs:
- job: Build
displayName: "Build & Publish Artifact"
pool:
vmImage: windows-2019
steps:
- checkout: FeatureFlightingGithub
- checkout: self
- task: NuGetToolInstaller@1
displayName: Use NuGet 4.3.0
inputs:
versionSpec: 4.3.0
checkLatest: true
- task: UseDotNet@2
displayName: Use .Net Core sdk 3.1.x
inputs:
version: 3.1.x
includePreviewVersions: true
- task: UseDotNet@2
displayName: Use .Net Core sdk 6.0.x
inputs:
version: 6.0.x
includePreviewVersions: true
- task: DotNetCoreCLI@2
displayName: Restore API (Microsoft.FeatureFlighting.sln)
inputs:
command: restore
projects: '**/Microsoft.FeatureFlighting.sln'
selectOrConfig: config
feedRestore: c94f6383-c859-4345-ad90-73d2e3bcb70f
nugetConfigPath: NuGet.Config
- task: DotNetCoreCLI@2
displayName: Build API (Microsoft.FeatureFlighting.sln)
inputs:
projects: '**/Microsoft.FeatureFlighting.sln'
- task: DotNetCoreCLI@2
displayName: Test API (*.Tests.csproj)
continueOnError: false
inputs:
command: test
projects: '**/*Tests.csproj'
- task: DotNetCoreCLI@2
displayName: Publish API (Microsoft.FeatureFlighting.sln)
inputs:
command: publish
publishWebProjects: false
projects: '**/Microsoft.FeatureFlighting.API.csproj'
arguments: --output $(Build.artifactstagingdirectory)
- task: DotNetCoreCLI@2
displayName: Restore Functional Tests (Microsoft.FeatureFlighting.Tests.Functional.sln)
inputs:
command: restore
projects: '**/Microsoft.FeatureFlighting.Tests.Functional.sln'
selectOrConfig: config
feedRestore: c94f6383-c859-4345-ad90-73d2e3bcb70f
nugetConfigPath: NuGet.Config
- task: DotNetCoreCLI@2
displayName: Build Functional Tests (Microsoft.FeatureFlighting.Tests.Functional.sln)
inputs:
projects: '**/Microsoft.FeatureFlighting.Tests.Functional.sln'
- task: DotNetCoreCLI@2
displayName: Publish Functional Tests (Microsoft.FeatureFlighting.Tests.Functional.sln)
inputs:
command: publish
publishWebProjects: false
projects: FeatureFlightingManagement/tests/functional/Tests/Microsoft.FeatureFlighting.Tests.Functional.csproj
arguments: --output $(Build.artifactstagingdirectory)
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'

- stage: Pre_Prod_Perf_Deploy
dependsOn:
- Build
condition: succeeded('Build')
jobs:
- deployment: Pre_Prod_Perf_Deploy_EUS
displayName: Performance Environment Deployment EUS
pool:
name: Azure Pipelines
vmImage: windows-2019
demands: vstest
variables:
KeyVault-EUS: 'kv-exp-ppe-eus'
AppService-EUS: 'feature-flights-management-api-perf-eus'
AppService-EUS-Staging: 'feature-flights-management-api-perf-eus-staging'
ResourceGroup: 'RG-FieldExperiencePlatform-Uat-01'
Subscription: '05a315f7-744f-4692-b9dd-1aed7c6cee64'
environment: 'PS-GCM-FeXP-Services-Pre-Prod'
strategy:
runOnce:
deploy:
steps:
- checkout: FeatureFlightingGithub
- checkout: self
- powershell: |
[string] $branchName = "refs/heads/master"
[string] $mainBranchName = "refs/heads/main"
[string] $branchNameHotfix = "hotfix"
if ($env:BUILD_SOURCEBRANCH -eq $branchName -Or $env:BUILD_SOURCEBRANCH -contains $mainBranchName -Or $env:BUILD_SOURCEBRANCH -contains $branchNameHotfix)
{
Write-Host $branchName "branch check passed. Release triggered" from $env:BUILD_SOURCEBRANCH branch.
}
else
{
[string] $text1 = "##vso[task.logissue type=error;]"
[string] $text2 = "Branch Policy Violation:"
[string] $text3 = " !="
[string] $text4 = " | "
[string] $text5 = "branch. Deployment stopped from"
[string] $text6 = "branch."

Write-Host "$text1 $text2 $env:BUILD_SOURCEBRANCH $text3 $branchName $text4 $mainBranchName $text5 $env:BUILD_SOURCEBRANCH $text6"

exit 1
}
displayName: 'Stop Release if not from master | main branch'
enabled: false
- task: AzurePowerShell@5
displayName: "Add Az IP Agent on UAT EUS KeyVault"
inputs:
azureSubscription: "FXP-Azure-Subscription (SPA)"
ScriptType: InlineScript
azurePowerShellVersion: "LatestVersion"
Inline: |
$VerbosePreference = "SilentlyContinue"
Set-AzContext -SubscriptionId '$(Subscription)'
# Installing MSIdentityTools Module
Write-Host "Installing MSIdentityTools Module to fetch the Azure published IP ranges"
Install-Module -Name MSIdentityTools -Scope CurrentUser -Force
# Allowed IP address.
Write-Host "Getting IP address of Azure DevOps agent"
$IPAddress = (Invoke-WebRequest myexternalip.com/raw -UseBasicParsing).Content
$IPAddressRange = '{0}/32' -f $IPAddress
# Allow current public IP address.
Add-AzKeyVaultNetworkRule -ResourceId '/subscriptions/$(Subscription)/resourceGroups/$(ResourceGroup)/providers/Microsoft.KeyVault/vaults/$(KeyVault-EUS)' -IpAddressRange $IPAddressRange -SubscriptionId '05a315f7-744f-4692-b9dd-1aed7c6cee64'
Write-Host "Successfully appended the IP Address for Azure DevOps" -ForegroundColor Green
FailOnStandardError: true
- task: AzureKeyVault@1
displayName: 'Azure Key Vault: Download Secrets'
inputs:
azureSubscription: 'FXP-Azure-Subscription (SPA)'
KeyVaultName: '$(KeyVault-EUS)'
SecretsFilter: 'Authentication-Secret,MS-Graph-Secret'
- template: templates/app-service-deploy.yml
parameters:
KeyVault: $(KeyVault-EUS)
AppService: $(AppService-EUS)
ResourceGroup: $(ResourceGroup)
FunctionalTestRunSettingsFile: 'PreProduction.runsettings'
AppServiceStaging: $(AppService-EUS-Staging)
DeploymentAppSettings: '-AppConfiguration:ConfigurationEnvLabel Feature-Flight-Management-Config-PPE -AppConfiguration:FeatureFlightsLabel PPE -Keyvault:EndpointUrl https://kv-exp-ppe-eus.vault.azure.net/ -FeatureManagement:* true'
- task: AzurePowerShell@5
displayName: "Delete Az IP Agent Address on UAT EUS KeyVault"
inputs:
azureSubscription: "FXP-Azure-Subscription (SPA)"
ScriptType: InlineScript
azurePowerShellVersion: "LatestVersion"
Inline: |
$VerbosePreference = "SilentlyContinue"
Set-AzContext -SubscriptionId '$(Subscription)'
# Installing MSIdentityTools Module
Write-Host "Installing MSIdentityTools Module to fetch the Azure published IP ranges"
Install-Module -Name MSIdentityTools -Scope CurrentUser -Force
# Allowed IP address.
Write-Host "Getting IP address of Azure DevOps agent"
$IPAddress = (Invoke-WebRequest myexternalip.com/raw -UseBasicParsing).Content
$IPAddressRange = '{0}/32' -f $IPAddress
# Delete current public IP address.
Remove-AzKeyVaultNetworkRule -ResourceId '/subscriptions/$(Subscription)/resourceGroups/$(ResourceGroup)/providers/Microsoft.KeyVault/vaults/$(KeyVault-EUS)' -IpAddressRange $IPAddressRange -SubscriptionId '05a315f7-744f-4692-b9dd-1aed7c6cee64'
Write-Host "Successfully deleted the IP Address for Azure DevOps" -ForegroundColor Green
FailOnStandardError: true
4 changes: 2 additions & 2 deletions assets/pipeline/cd-feature-flights-management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ stages:
versionSpec: 4.3.0
checkLatest: true
- task: UseDotNet@2
displayName: Use .Net Core sdk 3.1.x
displayName: Use .NET sdk 10.0.x
inputs:
version: 3.1.x
version: 10.0.x
includePreviewVersions: true
- task: DotNetCoreCLI@2
displayName: Restore API (Microsoft.FeatureFlighting.sln)
Expand Down
61 changes: 61 additions & 0 deletions assets/pipeline/ci-feature-flighting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
resources:
repositories:
- repository: FeatureFlightingGithub
type: github
endpoint: github.com
name: microsoft/FeatureFlightingManagement
trigger:
- main

trigger: none
name: Feature-Flighting-$(Date:yyyyMMdd)$(Rev:.rr)
jobs:
- job: Build
displayName: Agent job 1
pool:
vmImage: 'windows-2019'
steps:
- checkout: FeatureFlightingGithub
- task: NuGetToolInstaller@1
displayName: Use NuGet 4.3.0
inputs:
versionSpec: 4.3.0
checkLatest: true
- task: UseDotNet@2
displayName: Use .Net Core sdk 3.1.x
inputs:
version: 3.1.x
includePreviewVersions: true
- task: DotNetCoreCLI@2
displayName: Restore API (Microsoft.FeatureFlighting.sln)
inputs:
command: restore
projects: '**/Microsoft.FeatureFlighting.sln'
- task: DotNetCoreCLI@2
displayName: Build API (Microsoft.FeatureFlighting.sln)
inputs:
projects: '**/Microsoft.FeatureFlighting.sln'
- task: DotNetCoreCLI@2
displayName: Test API (Microsoft.FeatureFlighting.sln)
enabled: false
inputs:
command: test
projects: '**/*Tests.csproj'
arguments: --collect "Code coverage"
workingDirectory: src/service/
- task: DotNetCoreCLI@2
displayName: Restore Functional Tests (Microsoft.FXP.Flighting.Tests.FunctionalTest.csproj)
enabled: false
inputs:
command: restore
projects: tests/Microsoft.FXP.Experimentation.Tests/Microsoft.FXP.Flighting.Tests.FunctionalTest/Microsoft.FXP.Flighting.Tests.FunctionalTest.csproj
selectOrConfig: config
feedRestore: c94f6383-c859-4345-ad90-73d2e3bcb70f
nugetConfigPath: src/Microsoft.PS.FlightingService/NuGet.Config
- task: DotNetCoreCLI@2
enabled: false
displayName: Build Functional Tests (Microsoft.FXP.Flighting.Tests.FunctionalTest.csproj)
inputs:
projects: tests/Microsoft.FXP.Experimentation.Tests/Microsoft.FXP.Flighting.Tests.FunctionalTest/Microsoft.FXP.Flighting.Tests.FunctionalTest.csproj


4 changes: 2 additions & 2 deletions assets/pipeline/templates/app-service-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ steps:
Folder: '$(System.ArtifactsDirectory)/drop/FunctionalTests'

- task: UseDotNet@2
displayName: 'Use .Net Core sdk 3.1.x'
displayName: 'Use .NET sdk 10.0.x'
inputs:
version: 3.1.x
version: 10.0.x

- task: AzureKeyVault@1
displayName: 'Azure Key Vault: Download Secrets'
Expand Down
Loading
Loading