Validation is getting Skipped

Madhava Kumar 1 Reputation point
2020-11-04T14:34:12.943+00:00

HI team,

I am working on implementing VSTS pipelines for my client. I am trying the below scenarios.
My Target environment is Salesforce Sandbox.

  1. Pass condition==> I am creating a PR and Deploying to the Target environment Successfully.
  2. 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.
  3. 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'

Someone, please help with 2 and 3 questions from the above. That would be a great help.If possible please reply at the earliest.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
38,826 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.