Skip to content

added build scripts and pester tests #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 11, 2018

Conversation

TylerLeonhardt
Copy link
Member

This adds 3 things:

  • azure-functions-powershell-worker.build.ps1 - an InvokeBuild script that handles different tasks. NOTE: this is where the logic will be that will include Azure PowerShell in the Modules folder
  • a build.ps1 which is a thin wrapper around the Invoke-Build script so that users don't need to know the is-and-outs of InvokeBuild
  • Pester tests to test the helper Module

You can invoke the build script in many ways:

build.ps1 - just builds
build.ps1 -Clean - Cleans and builds
build.ps1 -Bootstrap - tells you what dependencies you are missing
build.ps1 -Test - Builds and tests both xunit and Pester

build.ps1 Outdated
@@ -0,0 +1,87 @@
#!/usr/bin/env pwsh
param(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot header oops


# Remove the built nuget package
Remove-Item -Recurse -Force package/bin -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force package/obj -ErrorAction SilentlyContinue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not git clean -fdx?


task Build {
exec { dotnet build }
exec { dotnet publish }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we pass in the configuration to use for the build and publish?

}

task Test {
Set-Location test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are assuming $pwd is at the root folder, is that a safe assumption? This is the case in other tasks too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is assumed because InvokeBuild sets the location to whatever BuildRoot is set to:
https://github.com/nightroman/Invoke-Build/wiki/Build-Scripts-Guidelines#use-the-default-or-custom-buildroot

Copy link
Contributor

@daxian-dbw daxian-dbw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign off with a few minor comments.

@TylerLeonhardt TylerLeonhardt merged commit 7f1779f into Azure:dev Sep 11, 2018
@TylerLeonhardt TylerLeonhardt deleted the build-and-test branch September 11, 2018 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants