-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add build and deploy YAML pipelines (#125)
* add yaml pipelines for framework * add yaml pipelines for dashboard Co-authored-by: Pim Simons <pim.simons@codit.eu>
- Loading branch information
1 parent
c5456bc
commit b864d64
Showing
12 changed files
with
504 additions
and
15 deletions.
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
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
24 changes: 24 additions & 0 deletions
24
dashboard/installation/pipelines/Templates/build-steps.yaml
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,24 @@ | ||
parameters: | ||
type: '' | ||
useBeta: '' | ||
storageAccountName: '' | ||
storageSasToken: '' | ||
|
||
steps: | ||
- task: PowerShell@2 | ||
displayName: 'Pull Sources' | ||
inputs: | ||
targetType: filePath | ||
filePath: './deploy/Invictus-GetSources.ps1' | ||
arguments: '-StorageAccountName "${{parameters.storageAccountName}}" -StorageSasToken "${{parameters.storageSasToken}}" -StorageContainerName "${{parameters.type}}" -SaveLocation "$(Build.ArtifactStagingDirectory)" -UseBeta ${{parameters.useBeta}}' | ||
|
||
- task: PublishPipelineArtifact@1 | ||
inputs: | ||
TargetPath: $(Build.ArtifactStagingDirectory) | ||
ArtifactName: ${{parameters.type}} | ||
publishLocation: 'pipeline' | ||
|
||
- task: PublishPipelineArtifact@1 | ||
inputs: | ||
TargetPath: deploy | ||
ArtifactName: scripts |
16 changes: 16 additions & 0 deletions
16
dashboard/installation/pipelines/Templates/dashboard-release-steps.yaml
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,16 @@ | ||
parameters: | ||
azureSubscription: '' | ||
deployScriptParameters: '' | ||
scriptPath: '' | ||
|
||
steps: | ||
- task: AzurePowerShell@4 | ||
displayName: 'Azure PowerShell' | ||
env: | ||
SYSTEM_ACCESSTOKEN: $(System.AccessToken) | ||
inputs: | ||
azureSubscription: '${{parameters.azureSubscription}}' | ||
ScriptPath: '${{parameters.scriptPath}}' | ||
ScriptArguments: '${{parameters.deployScriptParameters}}' | ||
azurePowerShellVersion: 2.6.0 | ||
pwsh: true |
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,53 @@ | ||
name: ${{ parameters.major }}.${{ parameters.minor }}.${{ parameters.patch }}$(rev:.r) | ||
|
||
pr: none | ||
trigger: | ||
branches: | ||
include: | ||
- main | ||
- feature/* | ||
paths: | ||
include: | ||
- /src/customer.azure.invictus | ||
|
||
parameters: | ||
- name: major | ||
displayName: Major Version | ||
type: string | ||
default: 4 | ||
- name: minor | ||
displayName: Minor Version | ||
type: string | ||
default: 15 | ||
- name: patch | ||
displayName: Patch Version | ||
type: string | ||
default: 10 | ||
- name: useBeta | ||
displayName: Use Beta | ||
type: string | ||
default: $False | ||
|
||
pool: | ||
vmImage: 'windows-latest' | ||
|
||
stages: | ||
- stage: Package | ||
displayName: Package | ||
dependsOn: [] | ||
variables: | ||
- group: invictus.installation | ||
jobs: | ||
- job: publish | ||
displayName: Build and Publish Dashboard | ||
steps: | ||
- checkout: self | ||
clean: true | ||
persistCredentials: true | ||
|
||
- template: ./Templates/build-steps.yaml | ||
parameters: | ||
type: 'dashboard' | ||
useBeta: '${{ parameters.useBeta }}' | ||
storageAccountName: '$(Invictus.Installation.StorageAccount.Name)' | ||
storageSasToken: '$(Invictus.Installation.StorageAccount.Dashboard.SasToken)' |
118 changes: 118 additions & 0 deletions
118
dashboard/installation/pipelines/dashboard.release.yaml
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,118 @@ | ||
name: $(Rev:r) # This is not used since we define it during the first stage | ||
|
||
pr: none | ||
|
||
trigger: none | ||
|
||
resources: | ||
pipelines: | ||
# Name of the pipeline resource inside this workflow. Used to reference the pipeline resources later on (e.g. download artifacts). | ||
- pipeline: _build | ||
# Name of the pipeline in Azure Pipelines | ||
source: 'customer.azure.invictus.dashboard.build' | ||
trigger: true | ||
|
||
variables: | ||
- name: Pipeline.Version | ||
value: $(resources.pipeline._build.runName) | ||
|
||
pool: | ||
vmImage: 'windows-latest' | ||
|
||
stages: | ||
- stage: preparation | ||
displayName: 'Prepare Deployment' | ||
jobs: | ||
- job: version | ||
displayName: Determine Version | ||
steps: | ||
- powershell: | | ||
$dateTime = $(Get-Date -format yyyyMMddHmmss) | ||
Write-Host "##vso[build.updatebuildnumber]$(Pipeline.Version)-$dateTime" | ||
Write-Host "Pipeline version is '$(Pipeline.Version)-$dateTime'" | ||
displayName: 'Change pipeline version' | ||
- stage: deploy_dev | ||
displayName: 'Deploy to Development' | ||
dependsOn: preparation | ||
variables: | ||
- group: infra.dev | ||
- group: invictus.dev | ||
jobs: | ||
- deployment: deploy_development | ||
displayName: 'Deploy to Development' | ||
environment: Development | ||
strategy: | ||
runOnce: | ||
deploy: | ||
steps: | ||
- download: '_build' | ||
displayName: Download Artifact | ||
- template: ./Templates/dashboard-release-steps.yaml | ||
parameters: | ||
azureSubscription: $(Infra.Environment.ServiceConnection) | ||
scriptPath: '$(Pipeline.Workspace)/_build/dashboard/Deploy.ps1' | ||
deployScriptParameters: '-resourcePrefix $(Infra.Environment.ResourcePrefix) -ArtifactsPath $(Pipeline.Workspace)/_build/dashboard -ResourceGroupName $(Infra.Environment.CustomerPrefix)-$(Infra.Environment.ShortName)-invictus -VariableGroupName invictus.$(Infra.Environment.ShortName) -devOpsObjectId "$(Infra.DevOps.Object.Id)" -servicePlanSkuName "B1" -eventHubSkuName "Standard" -eventHubSkuTier "Standard" -enableStatisticsFunction "true"' | ||
- stage: deploy_tst | ||
displayName: 'Deploy to Test' | ||
dependsOn: deploy_dev | ||
variables: | ||
- group: infra.tst | ||
- group: invictus.tst | ||
jobs: | ||
- deployment: deploy_tst | ||
displayName: 'Deploy to Test' | ||
environment: Test | ||
strategy: | ||
runOnce: | ||
deploy: | ||
steps: | ||
- download: '_build' | ||
displayName: Download Artifact | ||
- template: ./Templates/dashboard-release-steps.yaml | ||
parameters: | ||
azureSubscription: $(Infra.Environment.ServiceConnection) | ||
scriptPath: '$(Pipeline.Workspace)/_build/dashboard/Deploy.ps1' | ||
deployScriptParameters: '-resourcePrefix $(Infra.Environment.ResourcePrefix) -ArtifactsPath $(Pipeline.Workspace)/_build/dashboard -ResourceGroupName $(Infra.Environment.CustomerPrefix)-$(Infra.Environment.ShortName)-invictus -VariableGroupName invictus.$(Infra.Environment.ShortName) -devOpsObjectId "$(Infra.DevOps.Object.Id)" -servicePlanSkuName "B1" -eventHubSkuName "Standard" -eventHubSkuTier "Standard" -enableStatisticsFunction "true"' | ||
|
||
- stage: deploy_acc | ||
displayName: 'Deploy to Acceptance' | ||
dependsOn: deploy_tst | ||
variables: | ||
- group: infra.acc | ||
- group: invictus.acc | ||
jobs: | ||
- deployment: deploy_acc | ||
displayName: 'Deploy to Acceptance' | ||
environment: Acceptance | ||
strategy: | ||
runOnce: | ||
deploy: | ||
steps: | ||
- download: '_build' | ||
displayName: Download Artifact | ||
- template: ./Templates/dashboard-release-steps.yaml | ||
parameters: | ||
azureSubscription: $(Infra.Environment.ServiceConnection) | ||
scriptPath: '$(Pipeline.Workspace)/_build/dashboard/Deploy.ps1' | ||
deployScriptParameters: '-resourcePrefix $(Infra.Environment.ResourcePrefix) -ArtifactsPath $(Pipeline.Workspace)/_build/dashboard -ResourceGroupName $(Infra.Environment.CustomerPrefix)-$(Infra.Environment.ShortName)-invictus -VariableGroupName invictus.$(Infra.Environment.ShortName) -devOpsObjectId "$(Infra.DevOps.Object.Id)" -servicePlanSkuName "B1" -eventHubSkuName "Standard" -eventHubSkuTier "Standard" -enableStatisticsFunction "true"' | ||
- stage: deploy_prd | ||
displayName: 'Deploy to Production' | ||
dependsOn: deploy_acc | ||
variables: | ||
- group: infra.prd | ||
- group: invictus.prd | ||
jobs: | ||
- deployment: deploy_prd | ||
displayName: 'Deploy to Production' | ||
environment: Production | ||
strategy: | ||
runOnce: | ||
deploy: | ||
steps: | ||
- download: '_build' | ||
displayName: Download Artifact | ||
- template: ./Templates/dashboard-release-steps.yaml | ||
parameters: | ||
azureSubscription: $(Infra.Environment.ServiceConnection) | ||
scriptPath: '$(Pipeline.Workspace)/_build/dashboard/Deploy.ps1' | ||
deployScriptParameters: '-resourcePrefix $(Infra.Environment.ResourcePrefix) -ArtifactsPath $(Pipeline.Workspace)/_build/dashboard -ResourceGroupName $(Infra.Environment.CustomerPrefix)-$(Infra.Environment.ShortName)-invictus -VariableGroupName invictus.$(Infra.Environment.ShortName) -devOpsObjectId "$(Infra.DevOps.Object.Id)" -servicePlanSkuName "P1V2" -eventHubSkuName "Standard" -eventHubSkuTier "Standard" -enableStatisticsFunction "true"' |
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
Oops, something went wrong.