Skip to content

Instantly share code, notes, and snippets.

@staff0rd
Created September 23, 2020 06:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save staff0rd/8cb8aeea01ef783f1dd8db5b0b1ea6bd to your computer and use it in GitHub Desktop.
Save staff0rd/8cb8aeea01ef783f1dd8db5b0b1ea6bd to your computer and use it in GitHub Desktop.
A Salesforce pipeline in Azure DevOps
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task: sfpwowerscript-installsfdx-task@5
displayName: Install SFDX
- task: sfpwowerscript-authenticateorg-task@7
displayName: Authenticate with DevHub
inputs:
method: JWT
jwt_key_file: server.key
username: $(SalesforceUsername)
alias: DevHub
isdevhub: true
clientid: $(SalesforceClientId)
isTelemetryEnabled: true
- task: sfpwowerscript-authenticateorg-task@7
displayName: Authenticate with ScratchOrg
inputs:
method: JWT
jwt_key_file: server.key
username: $(ScratchOrgUsername)
alias: MyScratchOrg
isdevhub: false
clientid: $(SalesforceClientId)
isTelemetryEnabled: true
- task: sfpowerscript-deploysourcetoorg-task@5
displayName: Deploy source to scratch org
inputs:
project_directory: src
target_org: MyScratchOrg
source_directory: 'force-app'
checkonly: false
wait_time: '20'
testlevel: 'NoTestRun'
isTelemetryEnabled: true
- task: sfpwowerscript-triggerapextest-task@3
displayName: Run Apex Unit Tests
inputs:
target_org: 'MyScratchOrg'
testlevel: 'RunLocalTests'
wait_time: '60'
synchronous: false
isTelemetryEnabled: true
- task: sfpwowerscript-validateapextestcoverage-task@2
displayName: Validate 90% Apex Test Code Coverage
inputs:
target_org: 'MyScratchOrg'
test_coverage: '90'
isTelemetryEnabled: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment