Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Have build script add dependent modules (PSSA & Plaster) #1239

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
TylerLeonhardt merged 9 commits into PowerShell:master from TylerLeonhardt:appveyor-full-vsix
Mar 23, 2018

Conversation

Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Mar 21, 2018
edited
Loading

This will add PSSA and Plaster to our build so that the vsix AppVeyor spits out should be "release quality"

This vsix is a great example:
https://ci.appveyor.com/project/PowerShell/vscode-powershell/build/artifacts

@TylerLeonhardt TylerLeonhardt changed the title (削除) WIP: Have PSSA and Plaster added to build script (削除ここまで) (追記) Have build script add dependent modules (PSSA & Plaster) (追記ここまで) Mar 21, 2018
Copy link
Contributor

@rkeithhill rkeithhill left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

How about the PowerShellEditorServices.Commands? Does it get copied elsewhere?

Copy link
Member Author

I don't have that in my 1.6.0 modules folder? Where did you get that from?

Copy link
Contributor

OK that is weird. It is another module inside the PowerShellEditorServices folder.

Copy link
Member Author

@rkeithhill yeah just checked. That's inside the PowerShellEditorServices folder so it will be included in the vsix that this change generates 😄

rkeithhill reacted with thumbs up emoji

Copy link
Contributor

rjmholt commented Mar 22, 2018

Looks like Save-Module has minimum and maximum version parameters, which is perfect -- so I'm thinking here would be the right place for us to import some json config file and have a project-wide module version specification.

This looks good to go to me!

Copy link
Member Author

TylerLeonhardt commented Mar 22, 2018
edited
Loading

@rjmholt Added a modules.json file that includes all of our PowerShell module dependencies that we grab with Save-Module.

Note, since PowerShellGet doesn't have a concept of exclusive maximum versions I just put a very high 1.X version to account for any breaking changes that might come in a 2.0.

rjmholt reacted with hooray emoji

Copy link
Contributor

rjmholt commented Mar 22, 2018

Looks like -AllowPrerelease isn't supported by AppVeyor's version of Save-Module

Copy link
Member Author

Because their versions of PowerShell don't have latest version of PowerShellGet. :(

Copy link
Contributor

rjmholt commented Mar 22, 2018

Maybe

$params= @{
 <supportedParams> = <values>
}
if ((Get-Command "Save-Module").Parameters.ContainsKey("AllowPrerelease"))
{
 $params += @{ "AllowPrerelease" = $_.Value.AllowPrerelease }
}

appveyor.yml Outdated

build_script:
- ps: Invoke-Build
- powershell.exe -c "Invoke-Build"
Copy link
Member Author

@TylerLeonhardt TylerLeonhardt Mar 22, 2018

Choose a reason for hiding this comment

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

have to do this because of updating PowerShellGet

Copy link
Collaborator

@SeeminglyScience SeeminglyScience Mar 23, 2018

Choose a reason for hiding this comment

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

Should we be more explicit here? (e.g. -Command instead of -c)

rjmholt and TylerLeonhardt reacted with thumbs up emoji
Copy link
Member Author

Ok, now the builds will update PowerShellGet and save the modules correctly. Can I get another sign off?

- ulimit -n 4096
- powershell -File build/travis.ps1
- sudo powershell -c "Install-Module PowerShellGet -Force"
- powershell -File build/travis.ps1
Copy link
Contributor

@rkeithhill rkeithhill Mar 22, 2018

Choose a reason for hiding this comment

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

Does -File correctly report exit codes now? At one time it didn't.

Copy link
Member Author

@TylerLeonhardt TylerLeonhardt Mar 22, 2018

Choose a reason for hiding this comment

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

hmm not sure, I was just adding the install-module above it. Wasn't really focusing on the travis build script itself.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just tried pwsh in Windows 10:


Name Value
---- -----
PSVersion 6.0.1
PSEdition Core
GitCommitId v6.0.1-289-g18d0a0bcbd436b11611ec13f5b2b4b290e58b542
OS Microsoft Windows 10.0.16299
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Writing bad.ps1 as:

throw "Bad!"

Gives:

PS1> pwsh -File .\bad.ps1
Bad!
At C:\Users\roholt\bad.ps1:1 char:1
+ throw "Bad!"
+ ~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Bad!:String) [], RuntimeException
+ FullyQualifiedErrorId : Bad!
PS1> $LASTEXITCODE
1

Changing bad.ps1 to:

exit 1234

gives me:

PS1> pwsh -File .\bad.ps1
PS1> $LASTEXITCODE
1234

TylerLeonhardt reacted with thumbs up emoji
Copy link
Member Author

@TylerLeonhardt TylerLeonhardt Mar 22, 2018

Choose a reason for hiding this comment

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

huh. Interesting.

Copy link
Contributor

@rkeithhill rkeithhill Mar 22, 2018

Choose a reason for hiding this comment

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

Cool. Looks like it got fixed somewhere along the way. I just tested in 5.1 and it works there too. See Chris Oldwood's comment on this blog post - https://blogs.msdn.microsoft.com/powershell/2006/10/14/windows-powershell-exit-codes/

That is the behavior I remember.

TylerLeonhardt reacted with thumbs up emoji
Copy link
Member Author

@TylerLeonhardt TylerLeonhardt Mar 22, 2018

Choose a reason for hiding this comment

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

Good to know! Thanks for that, @rkeithhill.

}

task RestorePowerShellModules -If { -not (Test-Path "$PSScriptRoot/modules/Plaster") } {
$modules = Get-Content -Raw "./modules.json" | ConvertFrom-Json
Copy link
Collaborator

@SeeminglyScience SeeminglyScience Mar 23, 2018

Choose a reason for hiding this comment

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

Quotes aren't needed here, but nbd.

Copy link
Member Author

@TylerLeonhardt TylerLeonhardt Mar 23, 2018

Choose a reason for hiding this comment

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

added $PSScriptRoot

appveyor.yml Outdated

build_script:
- ps: Invoke-Build
- powershell.exe -c "Invoke-Build"
Copy link
Collaborator

@SeeminglyScience SeeminglyScience Mar 23, 2018

Choose a reason for hiding this comment

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

Should we be more explicit here? (e.g. -Command instead of -c)

rjmholt and TylerLeonhardt reacted with thumbs up emoji
@TylerLeonhardt TylerLeonhardt merged commit f1866cc into PowerShell:master Mar 23, 2018
@TylerLeonhardt TylerLeonhardt deleted the appveyor-full-vsix branch March 23, 2018 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@SeeminglyScience SeeminglyScience SeeminglyScience approved these changes

@daviwil daviwil Awaiting requested review from daviwil

+2 more reviewers

@rkeithhill rkeithhill rkeithhill approved these changes

@rjmholt rjmholt rjmholt approved these changes

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /