-
Notifications
You must be signed in to change notification settings - Fork 16
Getting Started
There are two ways of installing Unfold
The recommended way is to install Unfold in your user profile. Once this is done, you can add the scripts needed for deployment by executing the following PowerShell command:
Install-Unfold
This will add a folder called deployment
containing two files:
-
deploy.ps1
: the file that holds your deployment steps and configuration -
unfold.ps1
: a launcher script that will load the unfold module from your profile and executed the deployment script
Alternatively you can also install Unfold locally inside the project you want to deploy. To do so: open the Visual Studio Package Manager Console and type
Install-Package unfold
Preferrably inside a web project, but this is not required. This creates a deployment
folder in your project containing:
- a local copy of the unfold powershell library
- an
unfold.ps1
launcher script that can be used to launch deployment commands - the most important file:
deploy.ps1
, containing configuration settings and deployment tasks for your project
Now that unfold is in your project:
-
open the
deploy.ps1
file, it contains both the configuration values and custom tasks for your project. This is what you customize. Note that Visual Studio by default does not have support for PowerShell syntax highlighting, you might want to open the file in another editor or consider installing PowerGUI extensions or TextHighlighterExtensionSetup. Or you could simply use any other code editor. -
have a look at the examples
-
Open a powershell command-line into the deployment folder and execute (or change the directory of the Package Manager Console to the deployment folder)
.\unfold.ps1 deploy
-
check the output and adjust the configuration as needed
-
customize your deployment by writing custom tasks to the
deploy.ps1
file
Executing Unfold happens through the unfold.ps1
script. The following options are available
-
Executing a target, the default target (if any) is defined in your
deploy.ps1
script.\unfold.ps1 deploy
-
For a list of all available tasks, you can pass in the
-docs
switch.\unfold.ps1 -docs
-
Some tasks can have parameters (e.g. rollback) these are passed in using the -properties parameter, combined with a hashtable
.\unfold.ps1 rollback -properties @{to=5} -on production