Skip to content
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

New deployment type: PSGalleryScript #47

Open
RamblingCookieMonster opened this issue Jul 16, 2016 · 6 comments
Open

New deployment type: PSGalleryScript #47

RamblingCookieMonster opened this issue Jul 16, 2016 · 6 comments

Comments

@RamblingCookieMonster
Copy link
Owner

RamblingCookieMonster commented Jul 16, 2016

PSGalleryModule is up and running, would be handy to have a PSGalleryScript to go along with it, for example:

Deploy SomeScript {
    By PSGalleryScript {
        FromSource SomeScript.ps1
        To 'PSGallery' #Optional, default to gallery
        WithOptions @{
            ApiKey = '<my_api_key>'
            Guid = '' # Ideally we avoid a new GUID for every deployment... require here or maybe look up in the gallery, generate if not found?
            # Other params, see New-ScriptFileInfo for examples
        }
    }
}
@Plork
Copy link
Contributor

Plork commented Jul 18, 2016

Do you want to generate the "new-scriptfileinfo" block yourself or have people do that before uploading a script to PSGallery?

Test-ScriptFileInfo and if not generate it?

@Plork
Copy link
Contributor

Plork commented Jul 18, 2016

New-ScriptFileInfo and Update-ScriptFileInfo still seem a little dodgy :S so might wanna wait with this module a couple of updates ;)

New-ScriptFileInfo adds all the fields to the scriptfile not just the one you supplied.

Update-ScriptFileInfo does not except any of those fields to be $null even tho they are not mandatory. (does not help if you remove them form the fileinfo block.)

The variable cannot be validated because the value is not a valid value for the CompanyName variable.
The variable cannot be validated because the value is not a valid value for the Copyright variable.
The variable cannot be validated because the value $null is not a valid value for the RequiredModules variable.
The variable cannot be validated because the value $null is not a valid value for the ExternalModuleDependencies variable.
The variable cannot be validated because the value $null is not a valid value for the RequiredScripts variable.
The variable cannot be validated because the value $null is not a valid value for the ExternalScriptDependencies variable.
The variable cannot be validated because the value $null is not a valid value for the Tags variable.
The variable cannot be validated because the value $null is not a valid value for the ProjectUri variable.
The variable cannot be validated because the value $null is not a valid value for the LicenseUri variable.
The variable cannot be validated because the value $null is not a valid value for the IconUri variable.
You cannot call a method on a null-valued expression.

@RamblingCookieMonster
Copy link
Owner Author

Yep, those functions definitely have a ways to go. Guessing we'll need two paths:

  • Test-ScriptFileInfo on source passes: Use regex or another tool to update existing manifest (until Update-ScriptFileInfo works)
  • Test-ScriptFileInfo on source fails: Generate header based on WithOptions data.

Personally, I'll always use the latter. Planning to deploy a subset of functions from this misc repo, will let PSDeploy handle the headers, leave the source clean.

Cheers!

@Plork
Copy link
Contributor

Plork commented Jul 18, 2016

I am planning the latter as well, still in doubt to create folders per script and add a script.test.ps1 and script.psdeploy.ps1 but that's a different matter.

Yeah will need to implement both option for now till MS get's this fixed. Will see what I can do ;)

@RamblingCookieMonster
Copy link
Owner Author

Added a PSGalleryScript type marked as experimental. Definitely needs more work. Not even accounting for Test-ScriptFileInfo yet, at this point assuming all input files are devoid of script info data.

@Plork
Copy link
Contributor

Plork commented Aug 1, 2016

OneGet/oneget#185

so we need to wait a little while before Update-ScriptFileInfo works

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

No branches or pull requests

2 participants