Skip to content

Instantly share code, notes, and snippets.

View appcoreopc's full-sized avatar

jeremy woo appcoreopc

  • New Zealand
View GitHub Profile
parameters:
stageDependency: []
stageName: ''
environment: ''
displayName: ''
deployment: ''
stages:
- stage: ${{parameters.stageName}}
dependsOn: ${{parameters.stageDependency}}
stageName: ''
stageDependency: ''
targetServerGroup: $(prodOnPremServer)
packageName: $(packageNameClientApp)
targetWebsiteName: $(appPoolNamePROD)
installationPath: $(installationPathClientPROD)
targetport: $(targetportClientApp)
targetWebsiteAppPool: $(appPoolNamePROD)
artifactFeed: $(artifactFeed)
hostBindingsDev: '{"bindings":[{"protocol":"http","ipAddress":"All Unassigned","port":"80","hostname":"payments-dev","sslThumbprint":"","sniFlag":false}]}'
parameters:
stageDependency: []
stageName: ''
isMasterOrReleasableBranch: $[or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))]
- task: DotNetCoreCLI@2
displayName: Push to DevOps feed
condition: and(succeeded(), eq(variables.isMasterOrReleasableBranch, true))
inputs:
command: "push"
nuGetFeedType: "internal" # Required when command == push. Options: internal, external
packagesToPush: "$(Build.ArtifactStagingDirectory)/*.nupkg" # Required when command == push
publishVstsFeed: "API" # Required when command == push && NuGetFeedType == internal
- task: PowerShell@2
displayName: 'Setting packageVersion environment to versioning value.'
inputs:
targetType: 'inline'
script: |
$packageVersion = '$(majorVersion).$(minorVersion).$(Build.BuildId)'
Write-Host "##vso[task.setvariable variable=PackageVersion;]$packageVersion"
- task: NuGetCommand@2
displayName: Package Api
- task: DotNetCoreCLI@2
displayName: Publish Api
inputs:
command: "publish"
publishWebProjects: "false"
versioningScheme: "byBuildNumber"
workingDirectory: "$(Build.SourcesDirectory)"
projects: "**/*.Api.csproj"
arguments: "--output $(Build.ArtifactStagingDirectory) --configuration $(buildConfiguration)"
zipAfterPublish: "false"
@appcoreopc
appcoreopc / git_log_current_branch.txt
Created September 10, 2020 18:06
git log for current branch
If you're on the branch
git log master..
Otherwise
git log master..<your branch name>
- task: SonarQubeAnalyze@4
condition: and(succeeded(), or(eq(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/master')))
- task: SonarQubePublish@4
inputs:
pollingTimeoutSec: '300'
condition: and(succeeded(), or(eq(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/master')))
NCRONTAB examples
Here are some examples of NCRONTAB expressions you can use for the timer trigger in Azure Functions.
NCRONTAB EXAMPLES
Example When triggered
"0 */5 * * * *" once every five minutes
"0 0 * * * *" once at the top of every hour
"0 0 */2 * * *" once every two hours
"0 0 9-17 * * *" once every hour from 9 AM to 5 PM
"0 30 9 * * *" at 9:30 AM every day