-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix #34, along with prior commits… * Add docs * Bump for !Deploy
- Loading branch information
1 parent
15ecbe1
commit f197e5f
Showing
6 changed files
with
97 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
This example illustrates using the AppVeyorModule deployment to publish a module directly to AppVeyor. | ||
|
||
Here's the deployment config, My.PSDeploy.ps1: | ||
|
||
```PowerShell | ||
Deploy DeveloperBuild { | ||
By AppVeyorModule { | ||
FromSource MyModuleNameHere | ||
To AppVeyor | ||
} | ||
} | ||
``` | ||
|
||
In this example, we deploy both a zip file and a NuGet package to our AppVeyor build. | ||
|
||
This idea was borrowed from the PowerShell team's use of AppVeyor to distribute [development builds](https://github.com/PowerShell/DscResources#development-builds) for DSC resources. | ||
|
||
## Real Example | ||
|
||
Here's a quick example from PSDeploy itself: | ||
|
||
```PowerShell | ||
# Publish to AppVeyor if we're in AppVeyor | ||
if( | ||
$env:BHProjectName -and $ENV:BHProjectName.Count -eq 1 -and | ||
$env:BHBuildSystem -eq 'AppVeyor' | ||
) | ||
{ | ||
Deploy DeveloperBuild { | ||
By AppVeyorModule { | ||
FromSource $ENV:BHProjectName | ||
To AppVeyor | ||
WithOptions @{ | ||
Version = $env:APPVEYOR_BUILD_VERSION | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
The $ENV:BH* variables are created via [BuildHelpers](https://github.com/RamblingCookieMonster/BuildHelpers). | ||
|
||
Here are the resulting artifacts in the build: | ||
|
||
[![Source](images/appveyormodule.png)](images/appveyormodule.png) | ||
|
||
Note that by default, your project's NuGet feed may have some random characters to add uniqueness. To view or configure this URL in AppVeyor, browse to your project settings, NuGet tab: | ||
|
||
[![Source](images/appveyornuget.png)](images/appveyornuget.png) | ||
|
||
Now that I know the URL, I'm ready to register and use this feed: | ||
|
||
```PowerShell | ||
Register-PSRepository -Name PSDeploy -SourceLocation https://ci.appveyor.com/nuget/psdeploy | ||
Find-Module -Repository PSDeploy | ||
# Version Name Type Repository Description | ||
# ------- ---- ---- ---------- ----------- | ||
# 1.0.146 psdeploy Module PSDeploy psdeploy | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
This is a quick example showing a PSGalleryModule deployment: | ||
|
||
Here's the deployment config, My.PSDeploy.ps1: | ||
|
||
```PowerShell | ||
Deploy Module { | ||
By PSGalleryModule { | ||
FromSource MyModuleNameHere | ||
To PSGallery | ||
WithOptions @{ | ||
ApiKey = $ENV:NugetApiKey | ||
} | ||
} | ||
} | ||
``` | ||
|
||
In this example, we're deploying the module 'MyModuleNameHere' using an API key stored in $ENV:NugetApiKey. | ||
|
||
The API key might be stored in a [secure variable](https://www.appveyor.com/docs/build-configuration#secure-variables) of some sort for your build system. | ||
|
||
No output is produced from this deployment type. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.