Merge pull request #19 from loanDepot/kmarquette/issue-18
add support for Azure DevOps Pipelines
This commit is contained in:
@@ -2,17 +2,22 @@ task PublishModule {
|
|||||||
|
|
||||||
if ( $ENV:BHBuildSystem -ne 'Unknown' -and
|
if ( $ENV:BHBuildSystem -ne 'Unknown' -and
|
||||||
$ENV:BHBranchName -eq "master" -and
|
$ENV:BHBranchName -eq "master" -and
|
||||||
[string]::IsNullOrWhiteSpace($ENV:APPVEYOR_PULL_REQUEST_NUMBER) -and
|
-not [string]::IsNullOrWhiteSpace($ENV:nugetapikey))
|
||||||
-not [string]::IsNullOrWhiteSpace($ENV:NugetApiKey))
|
|
||||||
{
|
{
|
||||||
$publishModuleSplat = @{
|
$publishModuleSplat = @{
|
||||||
Path = $Destination
|
Path = $Destination
|
||||||
NuGetApiKey = $ENV:NugetApiKey
|
NuGetApiKey = $ENV:nugetapikey
|
||||||
Verbose = $true
|
Verbose = $true
|
||||||
Force = $true
|
Force = $true
|
||||||
Repository = $PSRepository
|
Repository = $PSRepository
|
||||||
ErrorAction = 'Stop'
|
ErrorAction = 'Stop'
|
||||||
}
|
}
|
||||||
|
"Files in module output:"
|
||||||
|
Get-ChildItem $Destination -Recurse -File |
|
||||||
|
Select-Object -Expand FullName
|
||||||
|
|
||||||
|
"Publishing [$Destination] to [$PSRepository]"
|
||||||
|
|
||||||
Publish-Module @publishModuleSplat
|
Publish-Module @publishModuleSplat
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -20,6 +25,7 @@ task PublishModule {
|
|||||||
"Skipping deployment: To deploy, ensure that...`n" +
|
"Skipping deployment: To deploy, ensure that...`n" +
|
||||||
"`t* You are in a known build system (Current: $ENV:BHBuildSystem)`n" +
|
"`t* You are in a known build system (Current: $ENV:BHBuildSystem)`n" +
|
||||||
"`t* You are committing to the master branch (Current: $ENV:BHBranchName) `n" +
|
"`t* You are committing to the master branch (Current: $ENV:BHBranchName) `n" +
|
||||||
|
"`t* The repository APIKey is defined in `$ENV:nugetapikey (Current: $(![string]::IsNullOrWhiteSpace($ENV:nugetapikey))) `n" +
|
||||||
"`t* This is not a pull request"
|
"`t* This is not a pull request"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
25
azure-pipelines.yml
Normal file
25
azure-pipelines.yml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# Starter pipeline
|
||||||
|
# Start with a minimal pipeline that you can customize to build and deploy your code.
|
||||||
|
# Add steps that build, run tests, deploy, and more:
|
||||||
|
# https://aka.ms/yaml
|
||||||
|
|
||||||
|
#resources:
|
||||||
|
#- repo: self
|
||||||
|
# clean: true
|
||||||
|
# fetchDepth: 1
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
batch: true
|
||||||
|
branches:
|
||||||
|
include:
|
||||||
|
- master
|
||||||
|
|
||||||
|
pool:
|
||||||
|
vmImage: 'Ubuntu 16.04'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- script: pwsh -File build.ps1 Publish
|
||||||
|
displayName: 'Build and Publish Module'
|
||||||
|
env:
|
||||||
|
nugetapikey: $(nugetapikey)
|
||||||
|
|
||||||
Reference in New Issue
Block a user