mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
pipeline file changes
This commit is contained in:
parent
7747f6bf0e
commit
ead88868aa
2 changed files with 81 additions and 19 deletions
|
|
@ -25,13 +25,19 @@ stages:
|
|||
clean: all
|
||||
|
||||
steps:
|
||||
- template: azure-pipelines-clean-agent.yml@self
|
||||
parameters:
|
||||
CleanArtifactsFolder: true
|
||||
CleanBinariesFolder: true
|
||||
CleanSourcesFolder: false
|
||||
CleanPublishFolder: true
|
||||
PublishFolder: ${{parameters.PublishFolder}}
|
||||
- task: PowerShell@2
|
||||
displayName: Output Build Parameters
|
||||
condition: contains(variables['system.debug'], 'true')
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
Write-Host "ApplicationName: ${{parameters.ApplicationName}}"
|
||||
Write-Host "SolutionFile: ${{parameters.SolutionFile}}"
|
||||
Write-Host "ProjectFile: ${{parameters.ProjectFile}}"
|
||||
Write-Host "PublishFolder: ${{parameters.PublishFolder}}"
|
||||
Write-Host "BuildConfiguration: ${{parameters.BuildConfiguration}}"
|
||||
Write-Host "BuildPlatform: ${{parameters.BuildPlatform}}"
|
||||
pwsh: true
|
||||
|
||||
- template: create-agent-capabilities-environment-variables.yml@self
|
||||
|
||||
|
|
|
|||
|
|
@ -36,29 +36,85 @@ stages:
|
|||
runOnce:
|
||||
deploy:
|
||||
steps:
|
||||
- template: azure-pipelines-clean-agent.yml@self
|
||||
parameters:
|
||||
CleanArtifactsFolder: true
|
||||
CleanBinariesFolder: true
|
||||
CleanSourcesFolder: true
|
||||
CleanPublishFolder: false
|
||||
PublishFolder: $(PublishFolder)
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: Output Deployment Details
|
||||
displayName: Output Deployment Parameters
|
||||
condition: contains(variables['system.debug'], 'true')
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
Write-Host "Deployment type: ${{parameters.DeploymentType}}"
|
||||
Write-Host "Publish folder: ${{parameters.PublishFolder}}"
|
||||
Write-Host "Repository folder: ${{parameters.RepositoryFolder}}"
|
||||
Write-Host "DeploymentType: ${{parameters.DeploymentType}}"
|
||||
Write-Host "DependsOn: ${{parameters.DependsOn}}"
|
||||
Write-Host "ApplicationName: ${{parameters.ApplicationName}}"
|
||||
Write-Host "PublishFolder: ${{parameters.PublishFolder}}"
|
||||
Write-Host "RepositoryFolder: ${{parameters.RepositoryFolder}}"
|
||||
pwsh: true
|
||||
|
||||
- template: output-environment-variables.yml@self
|
||||
|
||||
- checkout: MasterRepo
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: Copy ${{parameters.DeploymentType}} Files
|
||||
env:
|
||||
DEPLOY_BUILDNUMBER: $(Build.BuildNumber)
|
||||
DEPLOY_PUBLISHDIRECTORY: "$(Agent.BuildDirectory)/${{parameters.PublishFolder}}"
|
||||
DEPLOY_REPODIRECTORY: "$(Build.SourcesDirectory)/${{parameters.RepositoryFolder}}"
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
$appVersion = $env:DEPLOY_BUILDNUMBER
|
||||
$appVersionShort = $appVersion.Substring(0, $appVersion.LastIndexOf('.'))
|
||||
|
||||
# copy common files
|
||||
Copy-Item -Path "$env:DEPLOY_PUBLISHDIRECTORY\en-US.xaml" -Destination "$env:DEPLOY_REPODIRECTORY" -Force
|
||||
Copy-Item -Path "$env:DEPLOY_PUBLISHDIRECTORY\latest.zip" -Destination "$env:DEPLOY_REPODIRECTORY" -Force
|
||||
|
||||
# copy beta specific files
|
||||
if ('${{parameters.DeploymentType}}' -eq 'Beta') {
|
||||
Copy-Item -Path "$env:DEPLOY_PUBLISHDIRECTORY\latestBeta.txt" -Destination "$env:DEPLOY_REPODIRECTORY\latest.txt" -Force
|
||||
Copy-Item -Path "$env:DEPLOY_PUBLISHDIRECTORY\VersionFeedBeta.xml" -Destination "$env:DEPLOY_REPODIRECTORY\VersionFeed.xml" -Force
|
||||
}
|
||||
|
||||
# copy production specific files
|
||||
if ('${{parameters.DeploymentType}}' -eq 'Production') {
|
||||
$applicationFilenamePrefix = "${{parameters.ApplicationName}}_$appVersionShort"
|
||||
|
||||
Copy-Item -Path "$env:DEPLOY_PUBLISHDIRECTORY\$applicationFilenamePrefix.exe" -Destination "$env:DEPLOY_REPODIRECTORY" -Force
|
||||
Copy-Item -Path "$env:DEPLOY_PUBLISHDIRECTORY\$applicationFilenamePrefix.zip" -Destination "$env:DEPLOY_REPODIRECTORY" -Force
|
||||
Copy-Item -Path "$env:DEPLOY_PUBLISHDIRECTORY\latest.exe" -Destination "$env:DEPLOY_REPODIRECTORY" -Force
|
||||
Copy-Item -Path "$env:DEPLOY_PUBLISHDIRECTORY\latest.txt" -Destination "$env:DEPLOY_REPODIRECTORY" -Force
|
||||
Copy-Item -Path "$env:DEPLOY_PUBLISHDIRECTORY\VersionFeed.xml" -Destination "$env:DEPLOY_REPODIRECTORY" -Force
|
||||
}
|
||||
pwsh: true
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: Commit ${{parameters.DeploymentType}} Files (TODO)
|
||||
enabled: false
|
||||
env:
|
||||
DEPLOY_SOURCESDIRECTORY: $(Build.SourcesDirectory)
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
Write-Host "Committing ${{parameters.DeploymentType}} Files"
|
||||
pwsh: true
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: Update Pipeline Version Variables (TODO)
|
||||
enabled: false
|
||||
env:
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
if ('${{parameters.DeploymentType}}' -eq 'Beta') {
|
||||
Write-Host "Updating beta pipeline variables"
|
||||
}
|
||||
|
||||
if ('${{parameters.DeploymentType}}' -eq 'Production') {
|
||||
Write-Host "Updating production pipeline variables"
|
||||
}
|
||||
pwsh: true
|
||||
|
||||
- template: azure-pipelines-clean-agent.yml@self
|
||||
parameters:
|
||||
CleanArtifactsFolder: false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue