pipeline file changes

This commit is contained in:
Brett Hewitson 2022-12-23 17:02:59 +10:00
parent 2eacc92203
commit fcc91a1b02
2 changed files with 29 additions and 2 deletions

View file

@ -14,6 +14,10 @@ parameters:
type: string
- name: RepositoryFolder
type: string
- name: GitEmail
type: string
- name: GitUsername
type: string
stages:
- stage: deploy${{parameters.DeploymentType}}
@ -52,6 +56,7 @@ stages:
- template: output-environment-variables.yml@self
- checkout: MasterRepo
persistCredentials: true
- task: PowerShell@2
displayName: Copy ${{parameters.DeploymentType}} Files
@ -95,15 +100,33 @@ stages:
pwsh: true
- task: PowerShell@2
displayName: Commit ${{parameters.DeploymentType}} Files (TODO)
displayName: Commit ${{parameters.DeploymentType}} Files
enabled: false
env:
DEPLOY_SOURCESDIRECTORY: $(Build.SourcesDirectory)
inputs:
targetType: inline
script: |
Write-Host "Committing ${{parameters.DeploymentType}} Files"
Write-Host "Setting up the global configuration"
git config --global user.email "${{parameters.GitEmail}}"
git config --global user.name "${{parameters.GitUsername}}"
Write-Host "Performing Git Add"
git add .
Write-Host "Performing Git Commit"
if ('${{parameters.DeploymentType}}' -eq 'Beta') {
git commit -m "${{parameters.ApplicationName}} Beta $env:DEPLOY_BUILDNUMBER"
}
if ('${{parameters.DeploymentType}}' -eq 'Production') {
git commit -m "${{parameters.ApplicationName}} $env:DEPLOY_BUILDNUMBER"
}
Write-Host "Performing Git Push"
git push --set-upstream origin master --porcelain --force
pwsh: true
workingDirectory: '$(Build.SourcesDirectory)'
- task: PowerShell@2
displayName: Update Pipeline Version Variables (TODO)

View file

@ -45,6 +45,8 @@ stages:
ApplicationName: $(ApplicationName)
PublishFolder: $(PublishFolder)
RepositoryFolder: $(RepositoryFolderBeta)
GitEmail: $(GitEmail)
GitUsername: $(GitUsername)
- template: azure-pipelines-deploy.yml@self
parameters:
@ -53,3 +55,5 @@ stages:
ApplicationName: $(ApplicationName)
PublishFolder: $(PublishFolder)
RepositoryFolder: $(RepositoryFolderProduction)
GitEmail: $(GitEmail)
GitUsername: $(GitUsername)