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

Pass in user settings via command line #42

Closed
sayedihashimi opened this issue Feb 9, 2013 · 5 comments
Closed

Pass in user settings via command line #42

sayedihashimi opened this issue Feb 9, 2013 · 5 comments
Assignees

Comments

@sayedihashimi
Copy link
Owner

Currently all publishing settings are gathered from a .ps1 file. This makes it difficult to automate publishing to many environments.

We should be able to pass in specific parameters through the command line. This should be additive to the PublishConfiguration.ps1 file. When specific parameters are passed in they should take precedence over those found in the PublishConfiguration.ps1.

@tbehunin
Copy link

Nice! This one would have been my second pick to be resolved!

@sayedihashimi
Copy link
Owner Author

You can now pass in the Web Deploy parameters as a command line parameter.

How to use with a PublishConfiguration.ps1

If you are using a PublishConfiguraiton.ps1 you can just add the parameters to the end of the call to Publish-Interactive.ps1 as follows.

.\Publish-Interactive.ps1 "Computer name=waws-prod-bay-001.publish.azurewebsites.windows.net:443;Password=your-password-here'

If a parameter exists in both PublishConfiguraiton.ps1 as well as the command line, the command line value wins.

How to use without a PublishConfiguration.ps1

If you want to pass in all the Web Deploy parameters, and not use a PublishConfiguration.ps1 file then you need to additionally pass in the -NonInteractive switch.

.\Publish-Interactive.ps1 -NonInteractive 'Computer name=waws-prod-bay-001.publish.azurewebsites.windows.net:443;Password=your-password-here;IIS Web Application Name=sayedsample;Username=$sayedsample;Allow untrusted certificate=true;whatif=true;TransformName=release'

I have a drop for testing available at https://dl.dropbox.com/u/40134810/PackageWeb/issue-42/PackageWeb.1.1.8.11.zip.

@tbehunin
Copy link

Excellent! Does it matter if I use single or double quotes when entering params on the command line?

@sayedihashimi
Copy link
Owner Author

It shouldn't matter but they have different behavior in PowerShell. If you are not familiar with that I'd suggest you to look it up.

@keithl8041
Copy link

Note that this seems to be broken in the latest version - the workaround is to have a dummy PublishConfiguration.ps1 file and still specify your commands, so it looks something like;

.\Publish-Interactive.ps1 -NonInteractive PublishConfiguration.ps1 'Computer name=waws-prod-bay-001.publish.azurewebsites.windows.net:443;Password=your-password-here;IIS Web Application Name=sayedsample;Username=$sayedsample;Allow untrusted certificate=true;whatif=true;TransformName=release'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants