diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 0000000..fdae2fd --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,25 @@ +# Build script +init: + - git config --global core.autocrlf true + +# Build script +build_script: + - ps: .\build.ps1 -Target "AppVeyor" + +# Tests +test: off + +# Branches to build +branches: + # Whitelist + only: + - develop + - master + - /r/.*/ + - /release/.*/ + - /hotfix/.*/ + +# Build cache +cache: +- tools -> build.cake +- node_modules -> package.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..8459932 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,23 @@ +; This file is for unifying the coding style for different editors and IDEs. +; More information at http://EditorConfig.org + +root = true + +[*] +end_of_line = CRLF + +[*.ps1] +indent_style = space +indent_size = 2 + +[*.cs] +indent_style = space +indent_size = 4 + +[*.cake] +indent_style = space +indent_size = 4 + +[*.js] +indent_style = tab +indent_size = 2 diff --git a/CODEOFCONDUCT.md b/CODEOFCONDUCT.md new file mode 100644 index 0000000..6431c83 --- /dev/null +++ b/CODEOFCONDUCT.md @@ -0,0 +1,24 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. + +We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery +- Personal attacks +- Trolling or insulting/derogatory comments +- Public or private harassment +- Publishing other's private information, such as physical or electronic addresses, without explicit permission +- Other unethical or unprofessional conduct + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team. + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting a project maintainer at [abuse@gep13.co.uk](mailto:abuse@gep13.co.uk). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. Maintainers are obligated to maintain confidentiality with regard to the reporter of an incident. + +This Code of Conduct is adapted from the Contributor Covenant, version 1.3.0, available from http://contributor-covenant.org/version/1/3/0/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..c2503d8 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,148 @@ +# Contribution Guidelines + +* [Prerequisites](#prerequisites) +* [Definition of trivial contributions](#definition-of-trivial-contributions) +* [Contributing process](#contributing-process) + * [Get buyoff or find open community issues or features](#get-buyoff-or-find-open-community-issues-or-features) + * [Set up your environment](#Set-up-your-environment) + * [Prepare commits](#prepare-commits) + * [Submit pull request](#Submit-pull-request) + * [Respond to feedback on pull request](#respond-to-feedback-on-pull-request) +* [Other general information](#other-general-information) +* [Acknowledgement](#acknowledgement) + +## Prerequisites + +By contributing to this project, you assert that: + +* The contribution is your own original work. +* You have the right to assign the copyright for the work (it is not owned by your employer, or + you have been given copyright assignment in writing). +* You [license](https://github.com/gep13/chocolatey-azuredevops/blob/develop/LICENSE) the contribution under the terms applied to the rest of this project. +* You agree to follow the [code of conduct](https://github.com/gep13/chocolatey-azuredevops/blob/develop/CODEOFCONDUCT.md). + +## Definition of trivial contributions +It's hard to define what is a trivial contribution. Sometimes even a 1 character change can be considered significant. +Unfortunately because it can be subjective, the decision on what is trivial comes from the maintainers of the project +and not from folks contributing to the project. + +What is generally considered trivial: + +* Fixing a typo. +* Documentation changes. +* Fixes to non-production code - like fixing something small in the build code. + +What is generally not considered trivial: + + * Changes to any code that would be delivered as part of the final product. + This includes any scripts that are delivered, such as the PowerShell bootstrapper. + Yes, even 1 character changes could be considered non-trivial. + +## Contributing process +### Get buyoff or find open community issues or features + + * Through GitHub, or through the [Gitter chat](https://gitter.im/gep13/chocolatey-azuredevops) (preferred), + you talk about a feature you would like to see (or a bug), and why it should be included. + * If approved through the Gitter chat, ensure an accompanying GitHub issue is created with + information and a link back to the discussion. + * Once you get a nod from one of the maintainers, you can start on the feature. + * Alternatively, if a feature is on the issues list with the + [help wanted](https://github.com/gep13/chocolatey-azuredevops/labels/help%20wanted) label, + it is open for a community member (contributor) to patch. You should comment that you are signing up for it on the issue so someone else doesn't also sign up for the work. + +### Set up your environment + + * You create, or update, a fork of gep13/chocolatey-azuredeveops under your GitHub account. + * From there you create a branch named specific to the feature. + * In the branch you do work specific to the feature. + * Please also observe the following: + * No reformatting + * No changing files that are not specific to the feature. + * More covered below in the **Prepare commits** section. + * Test your changes and please help us out by updating and implementing some automated tests. + It is recommended that all contributors spend some time looking over the tests in the source code. + You can't go wrong emulating one of the existing tests and then changing it specific to the behavior you are testing. + * Please do not update your branch from the develop unless we ask you to. See the responding to feedback section below. + +### Prepare commits +This section serves to help you understand what makes a good commit. + +A commit should observe the following: + + * A commit is a small logical unit that represents a change. + * Should include new or changed tests relevant to the changes you are making. + * No unnecessary whitespace. Check for whitespace with `git diff --check` and `git diff --cached --check` before commit. + * You can stage parts of a file for commit. + +### Submit pull request +Prerequisites: + + * You are making commits in a feature branch. + * All code should compile without errors or warnings. + * All tests should be passing. + +Submitting PR: + + * Once you feel it is ready, submit the pull request to the `gep13/chocolatey-azuredevops` repository against the `develop` branch + unless specifically requested to submit it against another branch. + * In the case of a larger change that is going to require more discussion, + please submit a PR sooner. Waiting until you are ready may mean more changes than you are + interested in if the changes are taking things in a direction the maintainers do not want to go. + * In the pull request, outline what you did and point to specific conversations (as in URLs) + and issues that you are resolving. This is a tremendous help for us in evaluation and acceptance. + * Once the pull request is in, please do not delete the branch or close the pull request + (unless something is wrong with it). + * One of the team members, or one of the maintainers, will evaluate it within a + reasonable time period (which is to say usually within 1-3 weeks). Some things get evaluated + faster or fast tracked. We are human and we have active lives outside of open source so don't + fret if you haven't seen any activity on your pull request within a month or two. + We don't have a Service Level Agreement (SLA) for pull requests. + Just know that we will evaluate your pull request. + +### Respond to feedback on pull request + +We may have feedback for you to fix or change some things. We generally like to see that pushed against +the same topic branch (it will automatically update the Pull Request). You can also fix/squash/rebase +commits and push the same topic branch with `--force` (it's generally acceptable to do this on topic +branches not in the main repository, it is generally unacceptable and should be avoided at all costs +against the main repository). + +If we have comments or questions when we do evaluate it and receive no response, it will probably +lessen the chance of getting accepted. Eventually, this means it will be closed if it is not accepted. +Please know this doesn't mean we don't value your contribution, just that things go stale. If in the +future you want to pick it back up, feel free to address our concerns/questions/feedback and reopen +the issue/open a new PR (referencing old one). + +Sometimes we may need you to rebase your commit against the latest code before we can review it further. +If this happens, you can do the following: + + * `git fetch upstream` (upstream would be the mainstream repo or `gep13/chocolatey-azuredevops` in this case) + * `git checkout develop` + * `git rebase upstream/develop` + * `git checkout your-branch` + * `git rebase develop` + * Fix any merge conflicts + * `git push origin your-branch` (origin would be your GitHub repo or `your-github-username/chocolatey-azuredevops` in this case). + You may need to `git push origin your-branch --force` to get the commits pushed. + This is generally acceptable with topic branches not in the mainstream repository. + +The only reasons a pull request should be closed and resubmitted are as follows: + + * When the pull request is targeting the wrong branch (this doesn't happen as often). + * When there are updates made to the original by someone other than the original contributor. + Then the old branch is closed with a note on the newer branch this supersedes #github_number. + +## Other general information +If you reformat code or hit core functionality without an approval from a person on the Team, +it's likely that no matter how awesome it looks afterwards, it will probably not get accepted. +Reformatting code makes it harder for us to evaluate exactly what was changed. + +If you do these things, it will be make evaluation and acceptance easy. +Now if you stray outside of the guidelines we have above, it doesn't mean we are going to ignore +your pull request. It will just make things harder for us. +Harder for us roughly translates to a longer SLA for your pull request. + +## Acknowledgement + +This contribution guide was taken from the [Chocolatey project](https://chocolatey.org/) +with permission and was edited to follow conventions and processes used here. diff --git a/GitReleaseManager.yaml b/GitReleaseManager.yaml new file mode 100644 index 0000000..e8a95c8 --- /dev/null +++ b/GitReleaseManager.yaml @@ -0,0 +1,12 @@ +issue-labels-include: +- Bug +- Feature +- Improvement +- Documentation +- Breaking change +issue-labels-exclude: +- Build +issue-labels-alias: + - name: Documentation + header: Documentation + plural: Documentation diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2d0a190 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2018 Gary Ewan Park + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Tasks/chocolatey/chocolatey.ps1 b/Tasks/chocolatey/chocolatey.ps1 index c04d315..ff9f354 100644 --- a/Tasks/chocolatey/chocolatey.ps1 +++ b/Tasks/chocolatey/chocolatey.ps1 @@ -28,17 +28,14 @@ try { [string]$commandName = "" if($debug) { - Write-Output "Adding --debug to arguments" $chocolateyArguments.Add("--debug") > $null } if($verbose) { - Write-Output "Adding --verbose to arguments" $chocolateyArguments.Add("--verbose") > $null } if($trace) { - Write-Output "Adding --trace to arguments" $chocolateyArguments.Add("--trace") > $null } @@ -52,26 +49,22 @@ try { [string]$apikeyApikey = Get-VstsInput -Name 'apikeyApikey' -Require $commandName = "apikey" - $chocolateyArguments.Add("--source") > $null - $chocolateyArguments.Add($apikeySource) > $null - $chocolateyArguments.Add("--api-key") > $null - $chocolateyArguments.Add($apikeyApikey) > $null + $chocolateyArguments.Add("--source=`"'$apikeySource'`"") > $null + $chocolateyArguments.Add("--api-key=`"'$apikeyApikey'`"") > $null } "config" { [string]$configOperation = Get-VstsInput -Name 'configOperation' -Require [string]$configName = Get-VstsInput -Name 'configName' -Require - $chocolateyArguments.Add("--name") > $null - $chocolateyArguments.Add($configName) > $null + $chocolateyArguments.Add("--name=`"'$configName'`"") > $null $commandName = "config" if($configOperation -eq "set") { [string]$configValue = Get-VstsInput -Name 'configValue' -Require - $chocolateyArguments.Add("--value") > $null - $chocolateyArguments.Add($configValue) > $null + $chocolateyArguments.Add("--value=`"'$configValue'`"") > $null $chocolateyArguments.Insert(0, "set") > $null } else { $chocolateyArguments.Insert(0, "unset") > $null @@ -83,7 +76,6 @@ try { [string]$customArguments = Get-VstsInput -Name 'customArguments' if($customArguments) { - Write-Output "Adding custom arguments" $chocolateyArguments.Add($customArguments) > $null } @@ -95,8 +87,7 @@ try { [string]$featureName = Get-VstsInput -Name 'featureName' -Require $commandName = "feature" - $chocolateyArguments.Add("--name") > $null - $chocolateyArguments.Add($featureName) > $null + $chocolateyArguments.Add("--name=`"'$featureName'`"") > $null $chocolateyArguments.Insert(0, $featureOperation) > $null } @@ -113,57 +104,43 @@ try { [string]$installParams = Get-VstsInput -Name 'installParams' if([System.Version]::Parse($chocolateyVersion) -ge [System.Version]::Parse("0.9.8.33")) { - Write-Output "Adding -y to arguments" $chocolateyArguments.Add("-y") > $null } if([System.Version]::Parse($chocolateyVersion) -ge [System.Version]::Parse("0.10.4")) { - Write-Output "Adding --no-progress to arguments" $chocolateyArguments.Add("--no-progress") > $null } if($installPackageVersion) { - Write-Output "Adding --version to arguments" - $chocolateyArguments.Add("--version") > $null - $chocolateyArguments.Add($installPackageVersion) > $null + $chocolateyArguments.Add("--version=`"'$installPackageVersion'`"") > $null } if($installPre) { - Write-Output "Adding --pre to arguments" $chocolateyArguments.Add("--pre") > $null } if($installSource) { - Write-Output "Adding --source to arguments" - $chocolateyArguments.Add("--version") > $null - $chocolateyArguments.Add($installSource) > $null + $chocolateyArguments.Add("--source=`"'$installSource'`"") > $null } if($installForce) { - Write-Output "Adding --force to arguments" $chocolateyArguments.Add("--force") > $null } if($installX86) { - Write-Output "Adding --x86 to arguments" $chocolateyArguments.Add("--x86") > $null } if($installInstallArgs) { - Write-Output "Adding --install-arguments to arguments" - $chocolateyArguments.Add("--install-arguments") > $null - $chocolateyArguments.Add($installInstallArgs) > $null + $chocolateyArguments.Add("--install-arguments=`"'$installInstallArgs'`"") > $null } if($installOverride) { - Write-Output "Adding --override-arguments to arguments" $chocolateyArguments.Add("--override-arguments") > $null } if($installParams) { - Write-Output "Adding --package-parameters to arguments" - $chocolateyArguments.Add("--package-parameters") > $null - $chocolateyArguments.Add($installParams) > $null + $chocolateyArguments.Add("--package-parameters=`"'$installParams'`"") > $null } $chocolateyArguments.Insert(0, $installPackageId) > $null @@ -177,15 +154,11 @@ try { [string]$packOutputDirectory = Get-VstsInput -Name 'packOutputDirectory' if($packVersion) { - Write-Output "Adding --version to arguments" - $chocolateyArguments.Add("--version") > $null - $chocolateyArguments.Add($packVersion) > $null + $chocolateyArguments.Add("--version=`"'$packVersion'`"") > $null } if($packOutputDirectory) { - Write-Output "Adding --output-directory to arguments" - $chocolateyArguments.Add("--output-directory") > $null - $chocolateyArguments.Add($packOutputDirectory) > $null + $chocolateyArguments.Add("--output-directory=`"'$packOutputDirectory'`"") > $null } $commandName = "pack" @@ -200,26 +173,19 @@ try { [string]$pushTimeout = Get-VstsInput -Name 'pushTimeout' if($pushSource) { - Write-Output "Adding --source to arguments" - $chocolateyArguments.Add("--source") > $null - $chocolateyArguments.Add($pushSource) > $null + $chocolateyArguments.Add("--source=`"'$pushSource'`"") > $null } if($pushApikey) { - Write-Output "Adding --apikey to arguments" - $chocolateyArguments.Add("--apikey") > $null - $chocolateyArguments.Add($pushApikey) > $null + $chocolateyArguments.Add("--apikey=`"'$pushApikey'`"") > $null } if($pushForce) { - Write-Output "Adding --force to arguments" $chocolateyArguments.Add("--force") > $null } if($pushTimeout) { - Write-Output "Adding -t to arguments" - $chocolateyArguments.Add("-t") > $null - $chocolateyArguments.Add($pushTimeout) > $null + $chocolateyArguments.Add("-t=`"'$pushTimeout'`"") > $null } $commandName = "push" @@ -235,41 +201,29 @@ try { [string]$certPassword = Get-VstsInput -Name 'certPassword' [bool]$byPassProxy = Get-VstsInput -Name 'byPassProxy' -AsBool -Default $false - $chocolateyArguments.Add("--name") > $null - $chocolateyArguments.Add($sourceSourceName) > $null + $chocolateyArguments.Add("--name=`"'$sourceSourceName'`"") > $null if($sourcePriority) { - Write-Output "Adding --priority to arguments" - $chocolateyArguments.Add("--priority") > $null - $chocolateyArguments.Add($sourcePriority) > $null + $chocolateyArguments.Add("--priority=`"'$sourcePriority'`"") > $null } if($user) { - Write-Output "Adding --user to arguments" - $chocolateyArguments.Add("--user") > $null - $chocolateyArguments.Add($user) > $null + $chocolateyArguments.Add("--user=`"'$user'`"") > $null } if($password) { - Write-Output "Adding --password to arguments" - $chocolateyArguments.Add("--password") > $null - $chocolateyArguments.Add($password) > $null + $chocolateyArguments.Add("--password=`"'$password'`"") > $null } if($cert) { - Write-Output "Adding --cert to arguments" - $chocolateyArguments.Add("--cert") > $null - $chocolateyArguments.Add($cert) > $null + $chocolateyArguments.Add("--cert=`"'$cert'`"") > $null } if($certPassword) { - Write-Output "Adding --certpassword to arguments" - $chocolateyArguments.Add("--certpassword") > $null - $chocolateyArguments.Add($certPassword) > $null + $chocolateyArguments.Add("--certpassword=`"'$certPassword'`"") > $null } if($byPassProxy) { - Write-Output "Adding --bypass-proxy to arguments" $chocolateyArguments.Add("--bypass-proxy") > $null } @@ -280,8 +234,7 @@ try { "add" { [string]$sourceSource = Get-VstsInput -Name 'sourceSource' -Require - $chocolateyArguments.Add("--source") > $null - $chocolateyArguments.Add($sourceSource) > $null + $chocolateyArguments.Add("--source=`"'$sourceSource'`"") > $null $chocolateyArguments.Insert(0, "add") > $null } @@ -313,63 +266,47 @@ try { [string]$upgradeParams = Get-VstsInput -Name 'upgradeParams' if([System.Version]::Parse($chocolateyVersion) -ge [System.Version]::Parse("0.9.8.33")) { - Write-Output "Adding -y to arguments" $chocolateyArguments.Add("-y") > $null } if([System.Version]::Parse($chocolateyVersion) -ge [System.Version]::Parse("0.10.4")) { - Write-Output "Adding --no-progress to arguments" $chocolateyArguments.Add("--no-progress") > $null } if($upgradePackageVersion) { - Write-Output "Adding --version to arguments" - $chocolateyArguments.Add("--version") > $null - $chocolateyArguments.Add($upgradePackageVersion) > $null + $chocolateyArguments.Add("--version=`"'$upgradePackageVersion'`"") > $null } if($upgradePre) { - Write-Output "Adding --pre to arguments" $chocolateyArguments.Add("--pre") > $null } if($upgradeSource) { - Write-Output "Adding --source to arguments" - $chocolateyArguments.Add("--version") > $null - $chocolateyArguments.Add($upgradeSource) > $null + $chocolateyArguments.Add("--source=`"'$upgradeSource'`"") > $null } if($except) { - Write-Output "Adding --except to arguments" - $chocolateyArguments.Add("--except") > $null - $chocolateyArguments.Add($except) > $null + $chocolateyArguments.Add("--except=`"'$except'`"") > $null } if($upgradeForce) { - Write-Output "Adding --force to arguments" $chocolateyArguments.Add("--force") > $null } if($upgradeX86) { - Write-Output "Adding --x86 to arguments" $chocolateyArguments.Add("--x86") > $null } if($upgradeInstallArgs) { - Write-Output "Adding --install-arguments to arguments" - $chocolateyArguments.Add("--install-arguments") > $null - $chocolateyArguments.Add($upgradeInstallArgs) > $null + $chocolateyArguments.Add("--install-arguments=`"'$upgradeInstallArgs'`"") > $null } if($upgradeOverride) { - Write-Output "Adding --override-arguments to arguments" $chocolateyArguments.Add("--override-arguments") > $null } if($upgradeParams) { - Write-Output "Adding --package-parameters to arguments" - $chocolateyArguments.Add("--package-parameters") > $null - $chocolateyArguments.Add($upgradeParams) > $null + $chocolateyArguments.Add("--package-parameters=`"'$upgradeParams'`"") > $null } $chocolateyArguments.Insert(0, $upgradePackageId) > $null @@ -378,7 +315,6 @@ try { } if($extraArguments) { - Write-Output "Adding extra arguments" $chocolateyArguments.Add($extraArguments) } @@ -392,10 +328,18 @@ try { if($packOperation -eq "single") { [string]$packNuspecFileName = Get-VstsInput -Name 'packNuspecFileName' -Require & $chocoExe $commandName $packNuspecFileName $($chocolateyArguments) + + if($LASTEXITCODE -ne 0) { + throw "Something went wrong with Chocolatey execution. Check log for additional information." + } } else { $nuspecFiles = Get-ChildItem "*.nuspec" foreach($nuspecFile in $nuspecFiles) { & $chocoExe $commandName $nuspecFile $($chocolateyArguments) + + if($LASTEXITCODE -ne 0) { + throw "Something went wrong with Chocolatey execution. Check log for additional information." + } } } } elseif($commandName -eq 'push') { @@ -405,14 +349,26 @@ try { if($pushOperation -eq "single") { [string]$pushNupkgFileName = Get-VstsInput -Name 'pushNupkgFileName' -Require & $chocoExe $commandName $pushNupkgFileName $($chocolateyArguments) + + if($LASTEXITCODE -ne 0) { + throw "Something went wrong with Chocolatey execution. Check log for additional information." + } } else { $nupkgFiles = Get-ChildItem "*.nupkg" foreach($nupkgFile in $nupkgFiles) { & $chocoExe $commandName $nupkgFile $($chocolateyArguments) + + if($LASTEXITCODE -ne 0) { + throw "Something went wrong with Chocolatey execution. Check log for additional information." + } } } } else { & $chocoExe $commandName $($chocolateyArguments) + + if($LASTEXITCODE -ne 0) { + throw "Something went wrong with Chocolatey execution. Check log for additional information." + } } } catch { Write-VstsTaskError $_.Exception.Message diff --git a/Tasks/chocolatey/task.json b/Tasks/chocolatey/task.json index db5165a..2fbb596 100644 --- a/Tasks/chocolatey/task.json +++ b/Tasks/chocolatey/task.json @@ -4,7 +4,7 @@ "friendlyName": "Chocolatey", "description": "Run various Chocolatey commands, including pack, push, install, upgrade, etc.", "author": "gep13", - "helpMarkDown": "[More Information](https://gep13.co.uk/chocolatey-azuredevops", + "helpMarkDown": "[More Information](https://gep13.github.io/chocolatey-azuredevops/", "category": "Build", "visibility": [ "Build", @@ -85,7 +85,7 @@ "type": "pickList", "label": "Command", "defaultValue": "pack", - "helpMarkDown": "The Chocolatey command to run. Select 'Custom' to use a different command.", + "helpMarkDown": "The Chocolatey command to run. Select 'custom' to use other commands that are available [here](https://chocolatey.org/docs/commands-reference).", "required": "true", "properties": { "EditableOptions": "False" @@ -648,4 +648,4 @@ "workingDirectory": "$(currentDirectory)" } } -} \ No newline at end of file +} diff --git a/build.cake b/build.cake index 7443242..7b584e3 100644 --- a/build.cake +++ b/build.cake @@ -1,182 +1,182 @@ -////////////////////////////////////////////////////////////////////// -// ADDINS -////////////////////////////////////////////////////////////////////// - -#addin "nuget:?package=MagicChunks&version=1.1.0.34" -#addin "nuget:?package=Cake.Tfx&version=0.4.2" -#addin "nuget:?package=Cake.Npm&version=0.7.2" - -////////////////////////////////////////////////////////////////////// -// TOOLS -////////////////////////////////////////////////////////////////////// - -#tool "nuget:?package=gitreleasemanager&version=0.6.0" -#tool "nuget:?package=GitVersion.CommandLine&version=3.6.4" - -// Load other scripts. -#load "./build/parameters.cake" - -////////////////////////////////////////////////////////////////////// -// PARAMETERS -////////////////////////////////////////////////////////////////////// - -BuildParameters parameters = BuildParameters.GetParameters(Context, BuildSystem); -bool publishingError = false; - -/////////////////////////////////////////////////////////////////////////////// -// SETUP / TEARDOWN -/////////////////////////////////////////////////////////////////////////////// - -Setup(context => -{ - parameters.SetBuildVersion( - BuildVersion.CalculatingSemanticVersion( - context: Context, - parameters: parameters - ) - ); - - // Increase verbosity? - if(parameters.IsMasterCakeVsoBranch && (context.Log.Verbosity != Verbosity.Diagnostic)) { - Information("Increasing verbosity to diagnostic."); - context.Log.Verbosity = Verbosity.Diagnostic; - } - - Information("Building version {0} of cake-vso ({1}, {2}) using version {3} of Cake. (IsTagged: {4})", - parameters.Version.SemVersion, - parameters.Configuration, - parameters.Target, - parameters.Version.CakeVersion, - parameters.IsTagged); -}); - -////////////////////////////////////////////////////////////////////// -// TASKS -////////////////////////////////////////////////////////////////////// - -Task("Clean") - .Does(() => -{ - CleanDirectories(new[] { "./build-results" }); -}); - -Task("Install-Tfx-Cli") - .Does(() => -{ - Npm.WithLogLevel(NpmLogLevel.Silent).FromPath(".").Install(settings => settings.Package("tfx-cli").Globally()); -}); - -Task("Create-Release-Notes") - .Does(() => -{ - GitReleaseManagerCreate(parameters.GitHub.UserName, parameters.GitHub.Password, "cake-build", "cake-vso", new GitReleaseManagerCreateSettings { - Milestone = parameters.Version.Milestone, - Name = parameters.Version.Milestone, - Prerelease = true, - TargetCommitish = "master" - }); -}); - -Task("Update-Json-Versions") - .Does(() => -{ - var projectToPackagePackageJson = "vss-extension.json"; - Information("Updating {0} version -> {1}", projectToPackagePackageJson, parameters.Version.SemVersion); - - TransformConfig(projectToPackagePackageJson, projectToPackagePackageJson, new TransformationCollection { - { "version", parameters.Version.SemVersion } - }); - - var taskJson = "Tasks/chocolatey/task.json"; - Information("Updating {0} version -> {1}", taskJson, parameters.Version.SemVersion); - - TransformConfig(taskJson, taskJson, new TransformationCollection { - { "version/Major", parameters.Version.Major } - }); - - TransformConfig(taskJson, taskJson, new TransformationCollection { - { "version/Minor", parameters.Version.Minor } - }); - - TransformConfig(taskJson, taskJson, new TransformationCollection { - { "version/Patch", parameters.Version.Patch } - }); -}); - -Task("Package-Extension") - .IsDependentOn("Update-Json-Versions") - .IsDependentOn("Install-Tfx-Cli") - .IsDependentOn("Clean") - .Does(() => -{ - var buildResultDir = Directory("./build-results"); - - TfxExtensionCreate(new TfxExtensionCreateSettings() - { - ManifestGlobs = new List(){ "./vss-extension.json" }, - OutputPath = buildResultDir - }); -}); - -Task("Publish-GitHub-Release") - .WithCriteria(() => parameters.ShouldPublish) - .Does(() => -{ - var buildResultDir = Directory("./build-results"); - var packageFile = File("cake-build.cake-" + parameters.Version.SemVersion + ".vsix"); - - GitReleaseManagerAddAssets(parameters.GitHub.UserName, parameters.GitHub.Password, "cake-build", "cake-vso", parameters.Version.Milestone, buildResultDir + packageFile); - GitReleaseManagerClose(parameters.GitHub.UserName, parameters.GitHub.Password, "cake-build", "cake-vso", parameters.Version.Milestone); -}) -.OnError(exception => -{ - Information("Publish-GitHub-Release Task failed, but continuing with next Task..."); - publishingError = true; -}); - -Task("Publish-Extension") - .IsDependentOn("Package-Extension") - .WithCriteria(() => parameters.ShouldPublish) - .Does(() => -{ - var buildResultDir = Directory("./build-results"); - var packageFile = File("cake-build.cake-" + parameters.Version.SemVersion + ".vsix"); - - TfxExtensionPublish(buildResultDir + packageFile, new TfxExtensionPublishSettings() - { - AuthType = TfxAuthType.Pat, - Token = parameters.Marketplace.Token - }); -}) -.OnError(exception => -{ - Information("Publish-Extension Task failed, but continuing with next Task..."); - publishingError = true; -}); - -////////////////////////////////////////////////////////////////////// -// TASK TARGETS -////////////////////////////////////////////////////////////////////// - -Task("Default") - .IsDependentOn("Package-Extension"); - -Task("Appveyor") - .IsDependentOn("Publish-Extension") - .IsDependentOn("Publish-GitHub-Release") - .Finally(() => -{ - if(publishingError) - { - throw new Exception("An error occurred during the publishing of cake-vscode. All publishing tasks have been attempted."); - } -}); - -Task("ReleaseNotes") - .IsDependentOn("Create-Release-Notes"); - -////////////////////////////////////////////////////////////////////// -// EXECUTION -////////////////////////////////////////////////////////////////////// - -RunTarget(parameters.Target); +////////////////////////////////////////////////////////////////////// +// ADDINS +////////////////////////////////////////////////////////////////////// + +#addin "nuget:?package=MagicChunks&version=1.1.0.34" +#addin "nuget:?package=Cake.Tfx&version=0.4.2" +#addin "nuget:?package=Cake.Npm&version=0.7.2" + +////////////////////////////////////////////////////////////////////// +// TOOLS +////////////////////////////////////////////////////////////////////// + +#tool "nuget:?package=gitreleasemanager&version=0.7.1" +#tool "nuget:?package=GitVersion.CommandLine&version=3.6.4" + +// Load other scripts. +#load "./build/parameters.cake" + +////////////////////////////////////////////////////////////////////// +// PARAMETERS +////////////////////////////////////////////////////////////////////// + +BuildParameters parameters = BuildParameters.GetParameters(Context, BuildSystem); +bool publishingError = false; + +/////////////////////////////////////////////////////////////////////////////// +// SETUP / TEARDOWN +/////////////////////////////////////////////////////////////////////////////// + +Setup(context => +{ + parameters.SetBuildVersion( + BuildVersion.CalculatingSemanticVersion( + context: Context, + parameters: parameters + ) + ); + + // Increase verbosity? + if(parameters.IsMasterBranch && (context.Log.Verbosity != Verbosity.Diagnostic)) { + Information("Increasing verbosity to diagnostic."); + context.Log.Verbosity = Verbosity.Diagnostic; + } + + Information("Building version {0} of chocolatey-azuredevops ({1}, {2}) using version {3} of Cake. (IsTagged: {4})", + parameters.Version.SemVersion, + parameters.Configuration, + parameters.Target, + parameters.Version.CakeVersion, + parameters.IsTagged); +}); + +////////////////////////////////////////////////////////////////////// +// TASKS +////////////////////////////////////////////////////////////////////// + +Task("Clean") + .Does(() => +{ + CleanDirectories(new[] { "./build-results" }); +}); + +Task("Install-Tfx-Cli") + .Does(() => +{ + Npm.WithLogLevel(NpmLogLevel.Silent).FromPath(".").Install(settings => settings.Package("tfx-cli").Globally()); +}); + +Task("Create-Release-Notes") + .Does(() => +{ + GitReleaseManagerCreate(parameters.GitHub.UserName, parameters.GitHub.Password, "gep13", "chocolatey-azuredevops", new GitReleaseManagerCreateSettings { + Milestone = parameters.Version.Milestone, + Name = parameters.Version.Milestone, + Prerelease = true, + TargetCommitish = "master" + }); +}); + +Task("Update-Json-Versions") + .Does(() => +{ + var projectToPackagePackageJson = "vss-extension.json"; + Information("Updating {0} version -> {1}", projectToPackagePackageJson, parameters.Version.SemVersion); + + TransformConfig(projectToPackagePackageJson, projectToPackagePackageJson, new TransformationCollection { + { "version", parameters.Version.SemVersion } + }); + + var taskJson = "Tasks/chocolatey/task.json"; + Information("Updating {0} version -> {1}", taskJson, parameters.Version.SemVersion); + + TransformConfig(taskJson, taskJson, new TransformationCollection { + { "version/Major", parameters.Version.Major } + }); + + TransformConfig(taskJson, taskJson, new TransformationCollection { + { "version/Minor", parameters.Version.Minor } + }); + + TransformConfig(taskJson, taskJson, new TransformationCollection { + { "version/Patch", parameters.Version.Patch } + }); +}); + +Task("Package-Extension") + .IsDependentOn("Update-Json-Versions") + .IsDependentOn("Install-Tfx-Cli") + .IsDependentOn("Clean") + .Does(() => +{ + var buildResultDir = Directory("./build-results"); + + TfxExtensionCreate(new TfxExtensionCreateSettings() + { + ManifestGlobs = new List(){ "./vss-extension.json" }, + OutputPath = buildResultDir + }); +}); + +Task("Publish-GitHub-Release") + .WithCriteria(() => parameters.ShouldPublish) + .Does(() => +{ + var buildResultDir = Directory("./build-results"); + var packageFile = File("cake-build.cake-" + parameters.Version.SemVersion + ".vsix"); + + GitReleaseManagerAddAssets(parameters.GitHub.UserName, parameters.GitHub.Password, "gep13", "chocolatey-azuredevops", parameters.Version.Milestone, buildResultDir + packageFile); + GitReleaseManagerClose(parameters.GitHub.UserName, parameters.GitHub.Password, "gep13", "chocolatey-azuredevops", parameters.Version.Milestone); +}) +.OnError(exception => +{ + Information("Publish-GitHub-Release Task failed, but continuing with next Task..."); + publishingError = true; +}); + +Task("Publish-Extension") + .IsDependentOn("Package-Extension") + .WithCriteria(() => parameters.ShouldPublish) + .Does(() => +{ + var buildResultDir = Directory("./build-results"); + var packageFile = File("cake-build.cake-" + parameters.Version.SemVersion + ".vsix"); + + TfxExtensionPublish(buildResultDir + packageFile, new TfxExtensionPublishSettings() + { + AuthType = TfxAuthType.Pat, + Token = parameters.Marketplace.Token + }); +}) +.OnError(exception => +{ + Information("Publish-Extension Task failed, but continuing with next Task..."); + publishingError = true; +}); + +////////////////////////////////////////////////////////////////////// +// TASK TARGETS +////////////////////////////////////////////////////////////////////// + +Task("Default") + .IsDependentOn("Package-Extension"); + +Task("Appveyor") + .IsDependentOn("Publish-Extension") + .IsDependentOn("Publish-GitHub-Release") + .Finally(() => +{ + if(publishingError) + { + throw new Exception("An error occurred during the publishing of cake-vscode. All publishing tasks have been attempted."); + } +}); + +Task("ReleaseNotes") + .IsDependentOn("Create-Release-Notes"); + +////////////////////////////////////////////////////////////////////// +// EXECUTION +////////////////////////////////////////////////////////////////////// + +RunTarget(parameters.Target); diff --git a/build/parameters.cake b/build/parameters.cake index d407266..b52dac7 100644 --- a/build/parameters.cake +++ b/build/parameters.cake @@ -1,104 +1,104 @@ -#load "./version.cake" - -public class BuildParameters -{ - public string Target { get; private set; } - public string Configuration { get; private set; } - public bool IsLocalBuild { get; private set; } - public bool IsRunningOnUnix { get; private set; } - public bool IsRunningOnWindows { get; private set; } - public bool IsRunningOnAppVeyor { get; private set; } - public bool IsPullRequest { get; private set; } - public bool IsMasterCakeVsoRepo { get; private set; } - public bool IsMasterCakeVsoBranch { get; private set; } - public bool IsTagged { get; private set; } - public bool IsPublishBuild { get; private set; } - public bool IsReleaseBuild { get; private set; } - public bool SkipGitVersion { get; private set; } - public BuildCredentials GitHub { get; private set; } - public VisualStudioMarketplaceCredentials Marketplace { get; private set; } - public BuildVersion Version { get; private set; } - - public bool ShouldPublish - { - get - { - return !IsLocalBuild && !IsPullRequest && IsMasterCakeVsoRepo - && IsMasterCakeVsoBranch && IsTagged; - } - } - - public void SetBuildVersion(BuildVersion version) - { - Version = version; - } - - public static BuildParameters GetParameters( - ICakeContext context, - BuildSystem buildSystem - ) - { - if (context == null) - { - throw new ArgumentNullException("context"); - } - - var target = context.Argument("target", "Default"); - - return new BuildParameters { - Target = target, - Configuration = context.Argument("configuration", "Release"), - IsLocalBuild = buildSystem.IsLocalBuild, - IsRunningOnUnix = context.IsRunningOnUnix(), - IsRunningOnWindows = context.IsRunningOnWindows(), - IsRunningOnAppVeyor = buildSystem.AppVeyor.IsRunningOnAppVeyor, - IsPullRequest = buildSystem.AppVeyor.Environment.PullRequest.IsPullRequest, - IsMasterCakeVsoRepo = StringComparer.OrdinalIgnoreCase.Equals("cake-build/cake-vso", buildSystem.AppVeyor.Environment.Repository.Name), - IsMasterCakeVsoBranch = StringComparer.OrdinalIgnoreCase.Equals("master", buildSystem.AppVeyor.Environment.Repository.Branch), - IsTagged = ( - buildSystem.AppVeyor.Environment.Repository.Tag.IsTag && - !string.IsNullOrWhiteSpace(buildSystem.AppVeyor.Environment.Repository.Tag.Name) - ), - GitHub = new BuildCredentials ( - userName: context.EnvironmentVariable("CAKEVSO_GITHUB_USERNAME"), - password: context.EnvironmentVariable("CAKEVSO_GITHUB_PASSWORD") - ), - Marketplace = new VisualStudioMarketplaceCredentials ( - token: context.EnvironmentVariable("CAKEVSO_VSMARKETPLACE_TOKEN") - ), - IsPublishBuild = new [] { - "ReleaseNotes", - "Create-Release-Notes" - }.Any( - releaseTarget => StringComparer.OrdinalIgnoreCase.Equals(releaseTarget, target) - ), - IsReleaseBuild = new string[] { - }.Any( - publishTarget => StringComparer.OrdinalIgnoreCase.Equals(publishTarget, target) - ), - SkipGitVersion = StringComparer.OrdinalIgnoreCase.Equals("True", context.EnvironmentVariable("CAKE_SKIP_GITVERSION")) - }; - } -} - -public class BuildCredentials -{ - public string UserName { get; private set; } - public string Password { get; private set; } - - public BuildCredentials(string userName, string password) - { - UserName = userName; - Password = password; - } -} - -public class VisualStudioMarketplaceCredentials -{ - public string Token { get; private set; } - - public VisualStudioMarketplaceCredentials(string token) - { - Token = token; - } -} +#load "./version.cake" + +public class BuildParameters +{ + public string Target { get; private set; } + public string Configuration { get; private set; } + public bool IsLocalBuild { get; private set; } + public bool IsRunningOnUnix { get; private set; } + public bool IsRunningOnWindows { get; private set; } + public bool IsRunningOnAppVeyor { get; private set; } + public bool IsPullRequest { get; private set; } + public bool IsMasterRepo { get; private set; } + public bool IsMasterBranch { get; private set; } + public bool IsTagged { get; private set; } + public bool IsPublishBuild { get; private set; } + public bool IsReleaseBuild { get; private set; } + public bool SkipGitVersion { get; private set; } + public BuildCredentials GitHub { get; private set; } + public VisualStudioMarketplaceCredentials Marketplace { get; private set; } + public BuildVersion Version { get; private set; } + + public bool ShouldPublish + { + get + { + return !IsLocalBuild && !IsPullRequest && IsMasterRepo + && IsMasterBranch && IsTagged; + } + } + + public void SetBuildVersion(BuildVersion version) + { + Version = version; + } + + public static BuildParameters GetParameters( + ICakeContext context, + BuildSystem buildSystem + ) + { + if (context == null) + { + throw new ArgumentNullException("context"); + } + + var target = context.Argument("target", "Default"); + + return new BuildParameters { + Target = target, + Configuration = context.Argument("configuration", "Release"), + IsLocalBuild = buildSystem.IsLocalBuild, + IsRunningOnUnix = context.IsRunningOnUnix(), + IsRunningOnWindows = context.IsRunningOnWindows(), + IsRunningOnAppVeyor = buildSystem.AppVeyor.IsRunningOnAppVeyor, + IsPullRequest = buildSystem.AppVeyor.Environment.PullRequest.IsPullRequest, + IsMasterRepo = StringComparer.OrdinalIgnoreCase.Equals("gep13/chocolatey-azuredevops", buildSystem.AppVeyor.Environment.Repository.Name), + IsMasterBranch = StringComparer.OrdinalIgnoreCase.Equals("master", buildSystem.AppVeyor.Environment.Repository.Branch), + IsTagged = ( + buildSystem.AppVeyor.Environment.Repository.Tag.IsTag && + !string.IsNullOrWhiteSpace(buildSystem.AppVeyor.Environment.Repository.Tag.Name) + ), + GitHub = new BuildCredentials ( + userName: context.EnvironmentVariable("CHOCOLATEYAZUREDEVOPS_GITHUB_USERNAME"), + password: context.EnvironmentVariable("CHOCOLATEYAZUREDEVOPS_GITHUB_PASSWORD") + ), + Marketplace = new VisualStudioMarketplaceCredentials ( + token: context.EnvironmentVariable("CHOCOLATEYAZUREDEVOPS_VSMARKETPLACE_TOKEN") + ), + IsPublishBuild = new [] { + "ReleaseNotes", + "Create-Release-Notes" + }.Any( + releaseTarget => StringComparer.OrdinalIgnoreCase.Equals(releaseTarget, target) + ), + IsReleaseBuild = new string[] { + }.Any( + publishTarget => StringComparer.OrdinalIgnoreCase.Equals(publishTarget, target) + ), + SkipGitVersion = StringComparer.OrdinalIgnoreCase.Equals("True", context.EnvironmentVariable("CHOCOLATEYAZUREDEVOPS_SKIP_GITVERSION")) + }; + } +} + +public class BuildCredentials +{ + public string UserName { get; private set; } + public string Password { get; private set; } + + public BuildCredentials(string userName, string password) + { + UserName = userName; + Password = password; + } +} + +public class VisualStudioMarketplaceCredentials +{ + public string Token { get; private set; } + + public VisualStudioMarketplaceCredentials(string token) + { + Token = token; + } +} diff --git a/build/version.cake b/build/version.cake index 4935fe8..e867184 100644 --- a/build/version.cake +++ b/build/version.cake @@ -1,73 +1,73 @@ -public class BuildVersion -{ - public string Version { get; private set; } - public string SemVersion { get; private set; } - public string Milestone { get; private set; } - public string CakeVersion { get; private set; } - public string Major { get; private set; } - public string Minor { get; private set; } - public string Patch { get; private set; } - - public static BuildVersion CalculatingSemanticVersion( - ICakeContext context, - BuildParameters parameters - ) - { - if (context == null) - { - throw new ArgumentNullException("context"); - } - - string version = null; - string semVersion = null; - string milestone = null; - string major = null; - string minor = null; - string patch = null; - - if (!parameters.SkipGitVersion) - { - context.Information("Calculating Semantic Version"); - if (!parameters.IsLocalBuild || parameters.IsPublishBuild || parameters.IsReleaseBuild) - { - context.GitVersion(new GitVersionSettings{ - OutputType = GitVersionOutput.BuildServer - }); - - version = context.EnvironmentVariable("GitVersion_MajorMinorPatch"); - semVersion = context.EnvironmentVariable("GitVersion_LegacySemVerPadded"); - milestone = string.Concat("v", version); - major = context.EnvironmentVariable("GitVersion_Major"); - minor = context.EnvironmentVariable("GitVersion_Minor"); - patch = context.EnvironmentVariable("GitVersion_Patch"); - } - - GitVersion assertedVersions = context.GitVersion(new GitVersionSettings - { - OutputType = GitVersionOutput.Json, - }); - - version = assertedVersions.MajorMinorPatch; - semVersion = assertedVersions.LegacySemVerPadded; - milestone = string.Concat("v", version); - major = assertedVersions.Major.ToString(); - minor = assertedVersions.Minor.ToString(); - patch = assertedVersions.Patch.ToString(); - - context.Information("Calculated Semantic Version: {0}", semVersion); - } - - var cakeVersion = typeof(ICakeContext).Assembly.GetName().Version.ToString(); - - return new BuildVersion - { - Version = version, - SemVersion = semVersion, - Milestone = milestone, - CakeVersion = cakeVersion, - Major = major, - Minor = minor, - Patch = patch - }; - } -} +public class BuildVersion +{ + public string Version { get; private set; } + public string SemVersion { get; private set; } + public string Milestone { get; private set; } + public string CakeVersion { get; private set; } + public string Major { get; private set; } + public string Minor { get; private set; } + public string Patch { get; private set; } + + public static BuildVersion CalculatingSemanticVersion( + ICakeContext context, + BuildParameters parameters + ) + { + if (context == null) + { + throw new ArgumentNullException("context"); + } + + string version = null; + string semVersion = null; + string milestone = null; + string major = null; + string minor = null; + string patch = null; + + if (!parameters.SkipGitVersion) + { + context.Information("Calculating Semantic Version"); + if (!parameters.IsLocalBuild || parameters.IsPublishBuild || parameters.IsReleaseBuild) + { + context.GitVersion(new GitVersionSettings{ + OutputType = GitVersionOutput.BuildServer + }); + + version = context.EnvironmentVariable("GitVersion_MajorMinorPatch"); + semVersion = context.EnvironmentVariable("GitVersion_LegacySemVerPadded"); + milestone = string.Concat("v", version); + major = context.EnvironmentVariable("GitVersion_Major"); + minor = context.EnvironmentVariable("GitVersion_Minor"); + patch = context.EnvironmentVariable("GitVersion_Patch"); + } + + GitVersion assertedVersions = context.GitVersion(new GitVersionSettings + { + OutputType = GitVersionOutput.Json, + }); + + version = assertedVersions.MajorMinorPatch; + semVersion = assertedVersions.LegacySemVerPadded; + milestone = version; + major = assertedVersions.Major.ToString(); + minor = assertedVersions.Minor.ToString(); + patch = assertedVersions.Patch.ToString(); + + context.Information("Calculated Semantic Version: {0}", semVersion); + } + + var cakeVersion = typeof(ICakeContext).Assembly.GetName().Version.ToString(); + + return new BuildVersion + { + Version = version, + SemVersion = semVersion, + Milestone = milestone, + CakeVersion = cakeVersion, + Major = major, + Minor = minor, + Patch = patch + }; + } +} diff --git a/images/task.png b/images/task.png new file mode 100644 index 0000000..892abef Binary files /dev/null and b/images/task.png differ diff --git a/readme.md b/readme.md index 074b0e4..d8d6403 100644 --- a/readme.md +++ b/readme.md @@ -1 +1,51 @@ # Chocolatey Azure DevOps Tasks + +This extension brings support for [Chocolatey](https://chocolatey.org/) to Azure DevOps. + +## Table of Contents + +1. [What is Chocolatey?](#what-is-chocolatey) +1. [Tasks](#tasks) +1. [Resources](#resources) +1. [Thanks](#thanks) +1. [Contributing](#contributing) +1. [Releases](#releases) + +## What is Chocolatey? + +Chocolatey is a Package Manager for Windows, which allows the automation of all your software needs. + +For more information about [Chocolatey](https://chocolatey.org/), please see the Chocolatey Website or the Chocolatey [source code repository](https://github.com/chocolatey/choco). + + +## Tasks + +This extension contains only a single Task, which is capable of executing the following Chocolatey Commands: + +**NOTE:** This Azure DevOps Task assumes that Chocolatey is already installed on the Build Agent that is running the build. If Chocolatey is not located on the Build Agent, an error will be thrown, and the task will fail. + +* apikey +* config +* custom +* feature +* install +* pack +* push +* source +* upgrade + +## Resources + +Short YouTube videos of each of the releases of this extension can be found in this [playlist](https://www.youtube.com/playlist?list=PL84yg23i9GBhGahFf5-41vOJhn3D-6EUU). + +## Thanks + +The Chocolatey Azure DevOps Extension is modelled on the NuGet Extension, and many of the ideas in terms of how it functions, is based on how it works. + +## Contributing + +If you would like to see any other tasks or features added for this Azure DevOps Extension, feel free to raise an [issue](https://github.com/gep13/chocolatey-azuredevops/issues), and if possible, a follow up pull request. + +## Releases + +To find out what was released in each version of this extension, check out the [releases](https://github.com/gep13/chocolatey-azuredevops/releases) page. diff --git a/vss-extension.json b/vss-extension.json index ecaf340..c2f04d1 100644 --- a/vss-extension.json +++ b/vss-extension.json @@ -4,6 +4,7 @@ "version": "0.1.0", "name": "Chocolatey", "publisher": "gep13", + "public": true, "description": "A set of Tasks related to using Chocolatey as part of your Azure DevOps Build Pipelines.", "targets": [ { @@ -21,6 +22,25 @@ "color": "rgb(220, 235, 252)", "theme": "light" }, + "links": { + "learn": { + "uri": "https://gep13.github.io/chocolatey-azuredevops/" + }, + "license": { + "uri": "https://github.com/gep13/chocolatey-azuredevops/blob/develop/LICENSE" + }, + "repository": { + "uri": "https://github.com/gep13/chocolatey-azuredevops" + }, + "support": { + "uri": "https://github.com/gep13/chocolatey-azuredevops/issues" + } + }, + "screenshots": [ + { + "path": "images/task.png" + } + ], "content": { "details": { "path": "readme.md" @@ -59,4 +79,4 @@ "path": "Tasks/chocolatey" } ] -} \ No newline at end of file +}