Skip to content

Commit

Permalink
use default branch variable
Browse files Browse the repository at this point in the history
  • Loading branch information
FISHMANPET committed Jan 29, 2021
1 parent 4e62df1 commit 36063de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions PSModules/stages/deploy-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ parameters:
stages:
- stage: Deploy
dependsOn: Test
#condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master'))
#condition: and(succeeded(), eq(variables['build.sourceBranchName'], '${{ parameters.DefaultBranch }}'))
jobs:
- job: Publish
pool: Default
Expand Down Expand Up @@ -56,7 +56,7 @@ stages:
includeRootFolder: true
archiveType: zip
archiveFile: '$(Build.ArtifactStagingDirectory)\${{ parameters.ModuleName }}.zip'
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master'))
condition: and(succeeded(), eq(variables['build.sourceBranchName'], '${{ parameters.DefaultBranch }}'))
- powershell: |
gci env:
$auth = '${{ parameters.GitHubPAT }}'
Expand Down Expand Up @@ -85,7 +85,7 @@ stages:
$uploadurl = ($release.upload_url).Split('{')[0] + '?name=${{ parameters.ModuleName }}.zip'
($asset = Invoke-RestMethod -Uri $uploadurl -Method Post -InFile '$(Build.ArtifactStagingDirectory)\${{ parameters.ModuleName }}.zip' -Headers $ghHeader -ContentType 'application/zip')
displayName: Publish Release
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master'))
condition: and(succeeded(), eq(variables['build.sourceBranchName'], '${{ parameters.DefaultBranch }}'))
- deployment: Test
dependsOn: Publish
variables:
Expand All @@ -103,7 +103,7 @@ stages:
RepoName: ${{ parameters.RepoName }}
ModuleName: ${{ parameters.ModuleName }}
- deployment: Production
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master'))
condition: and(succeeded(), eq(variables['build.sourceBranchName'], '${{ parameters.DefaultBranch }}'))
dependsOn: Publish
variables:
PackageVersion: $[ dependencies.Publish.outputs['PublishModule.PackageVersion']]
Expand Down
3 changes: 3 additions & 0 deletions PSModules/umn-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ parameters:
- name: FailOnTestFailure
type: boolean
default: true
- name: DefaultBranch
type: string
default: master
- name: GitHubPAT
type: string
default: "this will fail"
Expand Down

0 comments on commit 36063de

Please sign in to comment.