From fcc91a1b028a3b817fa8abc561144d98af6389cc Mon Sep 17 00:00:00 2001 From: Brett Hewitson Date: Fri, 23 Dec 2022 17:02:59 +1000 Subject: [PATCH] pipeline file changes --- .azure/pipelines/azure-pipelines-deploy.yml | 27 +++++++++++++++++++-- .azure/pipelines/azure-pipelines.yml | 4 +++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.azure/pipelines/azure-pipelines-deploy.yml b/.azure/pipelines/azure-pipelines-deploy.yml index 80eaf541..b5d106e0 100644 --- a/.azure/pipelines/azure-pipelines-deploy.yml +++ b/.azure/pipelines/azure-pipelines-deploy.yml @@ -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) diff --git a/.azure/pipelines/azure-pipelines.yml b/.azure/pipelines/azure-pipelines.yml index 9f7732bc..7b1638b5 100644 --- a/.azure/pipelines/azure-pipelines.yml +++ b/.azure/pipelines/azure-pipelines.yml @@ -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)