Skip to content

Commit

Permalink
Reverted to using condition for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
lipkau committed Oct 1, 2018
1 parent b718368 commit 589380f
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions AtlassianPS.Configuration.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,21 @@ if ('AppVeyor' -eq $env:BHBuildSystem) {
$project = Get-AppVeyorProject
}

$shouldDeploy = (
# only deploy master branch
('master' -eq $env:BHBranchName) -and
# it cannot be a PR
# ( -not $env:APPVEYOR_PULL_REQUEST_NUMBER) -and
# only deploy from AppVeyor
('VSTS' -eq $env:BHBuildSystem) -and
# must be last job of AppVeyor
# (Test-IsLastJob) -and
# Travis-CI must be finished (if used)
# TODO: ( -not Test-TravisProgress) -and
# it cannot have a commit message that contains "skip-deploy"
($env:BHCommitMessage -notlike '*skip-deploy*')
)

#region SetUp
# Synopsis: Proxy task
task Init { Invoke-Init }
Expand Down Expand Up @@ -67,7 +82,6 @@ task GetNextVersion {
$manifestVersion = [Version](Get-Metadata -Path $env:BHPSModuleManifest)
$nextOnlineVersion = Get-NextNugetPackageVersion -Name $env:BHProjectName


if ( ($manifestVersion.Major -gt $nextOnlineVersion.Major) -or
($manifestVersion.Minor -gt $nextOnlineVersion.Minor)
# -or ($manifestVersion.Build -gt $nextOnlineVersion.Build)
Expand Down Expand Up @@ -116,6 +130,7 @@ task ShowInfo Init, GetNextVersion, {
Write-Build Gray ('Commit: {0}' -f $env:BHCommitMessage)
Write-Build Gray ('Build #: {0}' -f $env:BHBuildNumber)
Write-Build Gray ('Next Version: {0}' -f $env:NextBuildVersion)
Write-Build Gray ('Will deploy new version? {0}' -f $shouldDeploy)
Write-Build Gray '-------------------------------------------------------'
Write-Build Gray
Write-Build Gray ('PowerShell version: {0}' -f $PSVersionTable.PSVersion.ToString())
Expand Down Expand Up @@ -264,7 +279,7 @@ task Test Init, {

#region Publish
# Synopsis: Publish a new release on github and the PSGallery
task Deploy Init, PublishToGallery, TagReplository, UpdateHomepage
task Deploy -If ($shouldDeploy) Init, PublishToGallery, TagReplository, UpdateHomepage

# Synpsis: Publish the $release to the PSGallery
task PublishToGallery {
Expand Down

0 comments on commit 589380f

Please sign in to comment.