Validation is getting Skipped
Madhava Kumar
1
Reputation point
HI team,
I am working on implementing VSTS pipelines for my client. I am trying the below scenarios.
My Target environment is Salesforce Sandbox.
- Pass condition==> I am creating a PR and Deploying to the Target environment Successfully.
- Negative condition==> If the PR gets failed i am trying to revert the changes from the last pull revert from the Branch and asking the developer to correct the issues and create one more PR. But the question here is how to merge 2 PR's one is in failed condition and other one created to correct the failed component.
- Validating before deploying to the Target==> I am using the below Yaml file, but during validation, it is getting skipped. # Ant
Build your Java projects and run tests with Apache Ant.
Add steps that save build artifacts and more:
https://learn.microsoft.com/azure/devops/pipelines/languages/java
trigger:
- GPSIT
pool:
vmImage: 'vs2017-win2016'
jobs:
- job: GPSITDeploy
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
steps:- task: PowerShell@2
displayName: 'PowerShell Script'
inputs:
targetType: filePath
filePath: './Incremental-Script.ps1' - task: Ant@1
displayName: 'Pull Request Validation'
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
inputs:
workingDirectory: ''
buildFile: './build/build.xml'
options: -Dsalesforce.loginurl=$(salesforce.loginurl) -Dsalesforce.password=$(salesforce.password) -Dsalesforce.testLevel=$(salesforce.testLevel) -Dsalesforce.username=$(salesforce.username) validate
targets: 'deployCodeCheckOnly'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
testResultsFiles: '**/TEST-*.xml' - task: Ant@1
displayName: 'Pull Request Deployment'
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
inputs:
workingDirectory: ''
buildFile: './build/build.xml'
options: -Dsalesforce.loginurl=$(salesforce.loginurl) -Dsalesforce.password=$(salesforce.password) -Dsalesforce.testLevel=$(salesforce.testLevel) -Dsalesforce.username=$(salesforce.username) deploy
targets: 'deploy'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
testResultsFiles: '**/TEST-*.xml'
- task: PowerShell@2
Someone, please help with 2 and 3 questions from the above. That would be a great help.If possible please reply at the earliest.
Sign in to answer