Skip to content

Instantly share code, notes, and snippets.

@ThomasPe
Last active March 30, 2021 08:23
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ThomasPe/1058ecdfe75136519cca64bd34da175c to your computer and use it in GitHub Desktop.
Angular Branch Build 1
- script: ng build --configuration=dev
displayName: 'Build app (dev)'
condition: eq(variables['build.sourceBranch'], 'refs/heads/dev')
- script: ng build --configuration=staging
displayName: 'Build app (staging)'
condition: eq(variables['build.sourceBranch'], 'refs/heads/staging')
- script: ng build --configuration=production
displayName: 'Build app (production)'
condition: eq(variables['build.sourceBranch'], 'refs/heads/main')
variables:
${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}:
branchName: $[ replace(variables['Build.SourceBranch'], 'refs/heads/', '') ]
${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}:
branchName: $[ replace(variables['System.PullRequest.TargetBranch'], 'refs/heads/', '') ]
- script: ng build --configuration=dev
displayName: 'Build app (dev)'
condition: eq(variables['branchName'], 'dev')
- script: ng build --configuration=staging
displayName: 'Build app (staging)'
condition: eq(variables['branchName'], 'staging')
- script: ng build --configuration=production
displayName: 'Build app (production)'
condition: eq(variables['branchName'], 'main')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment