Skip to content

Commit

Permalink
Added even more diagnostic info and adjusted formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
replicaJunction committed Oct 8, 2015
1 parent 09b4a8a commit e9bc536
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
11 changes: 7 additions & 4 deletions Tests/Appveyor.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,18 @@ if ($env:CI -ne $true)

Write-Host
Write-Host ('Project name: {0}' -f $env:APPVEYOR_PROJECT_NAME) -ForegroundColor Cyan
Write-Host ('Commit: {0}' -f $env:APPVEYOR_REPO_COMMIT) -ForegroundColor Cyan
Write-Host (' - Author: {0}' -f $env:APPVEYOR_REPO_COMMIT_AUTHOR) -ForegroundColor Cyan
Write-Host (' - Time: {0}' -f $env:APPVEYOR_REPO_COMMIT_TIMESTAMP) -ForegroundColor Cyan
Write-Host (' - Message: {0}' -f $env:APPVEYOR_REPO_COMMIT_MESSAGE) -ForegroundColor Cyan
Write-Host (' - Extended message: {0}' -f $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED) -ForegroundColor Cyan
Write-Host ('AppVeyor build ID: {0}' -f $env:APPVEYOR_BUILD_ID) -ForegroundColor Cyan
Write-Host ('AppVeyor build number: {0}' -f $env:APPVEYOR_BUILD_NUMBER) -ForegroundColor Cyan
Write-Host ('AppVeyor build version: {0}' -f $env:APPVEYOR_BUILD_VERSION) -ForegroundColor Cyan
Write-Host ('AppVeyor Job ID: {0}' -f $JobID) -ForegroundColor Cyan
Write-Host ('Commit message: {0}' -f $env:APPVEYOR_REPO_COMMIT_MESSAGE) -ForegroundColor Cyan
Write-Host ('Extended commit message: {0}' -f $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED) -ForegroundColor Cyan
Write-Host ('AppVeyor job ID: {0}' -f $JobID) -ForegroundColor Cyan
Write-Host ('Build triggered from tag? {0}' -f $env:APPVEYOR_REPO_TAG) -ForegroundColor Cyan
Write-Host (' - Tag name: {0}' -f $env:APPVEYOR_REPO_TAG_NAME) -ForegroundColor Cyan
Write-Host ('PowerShell version: {0}' -f $PSVersionTable.PSVersion.ToString())
Write-Host ('PowerShell version: {0}' -f $PSVersionTable.PSVersion.ToString()) -ForegroundColor Cyan
Write-Host

Write-Host "AppVeyor tests initialized (Job ID $JobId)" -ForegroundColor Cyan
Expand Down
13 changes: 10 additions & 3 deletions Tests/Deploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ function Update-ModuleManifest {
Set-Content -Path $Path -Value $ManifestContent

$ManifestContent -match '(?<=ModuleVersion\s+=\s+'')(?<ModuleVersion>.*)(?='')' | Out-Null
Write-Host ('Module Version patched: ' + $Matches.ModuleVersion)
Write-Host 'Module Version patched: ' -ForegroundColor Cyan -NoNewline
Write-Host $Matches.ModuleVersion -ForegroundColor Green
}
#endregion

Expand All @@ -47,9 +48,11 @@ Write-Host $ModuleRoot -ForegroundColor Green

$shouldDeploy = $false
if ($env:APPVEYOR_REPO_COMMIT_MESSAGE -notmatch '\[release\]' -and $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED -notmatch 'release') {
Write-Host "This commit does not include the message [release], so it will not be published."
Write-Host "This commit does not include the message " -ForegroundColor Yellow -NoNewline
Write-Host "[release]" -ForegroundColor Green -NoNewline
Write-Host ", so it will not be published." -ForegroundColor Yellow
} elseif ($env:APPVEYOR_REPO_BRANCH -ne 'master') {
Write-Host "This commit is not to branch [master], so it will not be published."
Write-Host "This commit is not to branch [master], so it will not be published." -ForegroundColor Yellow
} elseif ($PSVersionTable.PSVersion -lt '5.0.0') {
Write-Warning "We are not running in a PowerShell 5 environment, so the module cannot be pulbished."
} else {
Expand Down Expand Up @@ -90,3 +93,7 @@ if ($shouldDeploy)
Write-Host "Publishing module to PowerShell Gallery" -BackgroundColor Blue -ForegroundColor White
Publish-Module @publishParams
}

Write-Host
Write-Host "=== Completed Deploy.ps1 ===" -ForegroundColor Green
Write-Host

0 comments on commit e9bc536

Please sign in to comment.