Skip to content

Instantly share code, notes, and snippets.

@balindersingh
Last active August 6, 2020 12:42
Show Gist options
  • Save balindersingh/3f6bc168ccdab04526d10eb4f6d62275 to your computer and use it in GitHub Desktop.
Save balindersingh/3f6bc168ccdab04526d10eb4f6d62275 to your computer and use it in GitHub Desktop.
Sample-pipeline-code
# image: if want to use custom docker image. The recipe in dockerhub
resources:
containers:
- container: mycustomimage
image: balindersingh/salesforce-deploy
# default container
pool:
vmImage: 'windows-latest'
# trigger on standard branches
trigger:
branches:
include:
- master
- feature/*
# trigger on every pull Request
pr:
branches:
include:
- '*'
- job: oneverypullrequest
condition: eq(variables['Build.Reason'], 'PullRequest')
steps:
- script: echo "This runs on every pull request for any branch."
- job: masterbranch
condition: and(eq(variables['build.SourceBranchName'], 'master'), ne(variables['Build.Reason'], 'PullRequest'))
steps:
- script: echo "This script runs only on commit to the master branch."
- job: featurebranches
condition: and(startsWith(variables['build.SourceBranchName'], 'feature-'), ne(variables['Build.Reason'], 'PullRequest'))
steps:
- script: echo "This script runs only on commit to branches with names that match the feature/* pattern."
# image: balindersingh/salesforce-deploy # if want to use custom docker image as default image. The recipe in dockerhub
pipelines:
pull-requests:
'**': #this runs on every pull request for any branch
- step:
script:
- echo "This runs on every pull request for any branch."
branches:
master:
- step:
script:
- echo "This script runs only on commit to the master branch."
feature/*:
- step:
script:
- echo "This script runs only on commit to branches with names that match the feature/* pattern."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment