-
Notifications
You must be signed in to change notification settings - Fork 8
Common Task Properties
Every Whiskey task has these properties.
- Debug
- ErrorAction
- ExceptBy
- ExceptDuring
- ExceptOnBranch
- ExceptOnPlatform
- IfExists
- InformationAction
- OnlyBy
- OnlyDuring
- OnlyOnBranch
- OnlyOnPlatform
- OutVariable
- UnlessExists
- Verbose
- WarningAction
- WorkingDirectory
Shows a task's debug messages in your build output. Must be set to true
, 1
, or yes
.
Build:
- Log:
Debug: true
Level: Debug
Message: Some debug-level information.
Controls how a task's errors are handled. To fail a build if an error is written, set this to Stop
. To hide any errors the task is writing, set this to Ignore
. This property has no effect on any errors a task may write that fails/terminates a build, i.e. this property only applies to non-terminating errors.
- Log:
ErrorAction: Stop
Level: Error
Message: Stop the build!
Controls if a task runs if the build was not started by a developer or a build server. By default, a task always runs. Valid values are Developer
or BuildServer
. If set to Developer
, does not run when the build is running by a developer. If set to BuildServer
, does not run when run by a build server.
- Log:
ExceptBy: Developer
Message: Only build servers will see this message.
Controls what run modes a task will not run under. Valid values and modes are Initialize
, Build
, and Clean
. Can be set to multiple modes. If set, the task will run in all modes but the ones in the list. Make sure the task actually runs in the chosen mode. Some tasks don't have anything to clean or initialize, in which case these properties would have no affect.
Build:
- Log:
ExceptDuring: Build
Message: I'm either cleaning or initializing.
Controls what branch a task should not run on. By default, a task runs on every branch. When a build is run by a developer, there is no branch information, so tasks that have this property will never run. Wildcards are supported.
Build:
- Log:
ExceptOnBranch: "feature/*"
Message: I'm not running on a feature branch.
Controls the platforms on which the task will not run. By default, a task runs on all platforms. Supported platforms and values are Windows
, Linux
, and MacOS
. Can be a list of multiple platforms.
Build:
- Log:
ExceptOnPlatform:
- MacOS
- Linux
Message: I'm running on Windows!
Only runs a task if an item exists. You can use any PowerShell-supported path:
-
env:ENV_NAME
for environment variables -
hklm:\path\to\key
for registry keys -
path\to\file
for files/directories
Relative paths are file system paths and are resolved from the directory of the build root or the task's working directory
Build:
- Log:
IfExists: "env:ENABLE_LOGGING"
Message: Only show this message if the ENABLE_LOGGING environment variable exists.
Controls the visibility of a task's information messages. Valid values are:
-
Stop
: fail the build if the task writes an information message -
Continue
: show a task's information messages (the default) -
Ignore
: don't write any information messages -
SilentlyContinue
: write but don't show any information messages
Build:
- Log:
InformationAction: Ignore
Message: I'm not visible. Seems like a strange thing to do.
Controls if a task runs if the build was started by a developer or a build server. By default, a task always runs. Valid values are Developer
or BuildServer
. If set to Developer
, only runs when the build is running by a developer. If set to BuildServer
, only runs when the build is running by a build server.
- Log:
OnlyBy: Developer
Message: Only developers will see this message.
Controls what run modes a task will run under. Valid values and modes are Initialize
, Build
, and Clean
. Can be set to multiple modes. If set, the task will run in all the modes in the list. Make sure the task actually runs in the chosen mode. Some tasks don't have anything to clean or initialize, in which case these properties would have no affect.
- Log:
OnlyDuring: Build
Message: You'll only see this when building.
Controls what branch a task should run on. By default, a task runs on every branch. Use this to only run a task on specific branches. When a build is run by a developer, there is no branch information, so tasks that have this property will never run. Wildcards are supported.
Build:
- Log:
OnlyOnBranch: "feature/*"
Message: I'm only running on feature branches.
Controls the platforms on which the task will run. By default, a task runs on all platforms. Supported platforms and values are Windows
, Linux
, and MacOS
. Can be a list of multiple platforms.
Build:
- Log:
OnlyOnPlatform:
- MacOS
- Linux
Message: I'm never running on Windows!
Redirects a task's output to a Whiskey variable. The task output will not be visible in the build log.
Build:
- Exec:
OutVariable: TASK_OUTPUT
Path: cmd.exe
Argument:
- /C
- ECHO I will be redirected to the TASK_OUTPUT Whiskey variable.
Only runs a task if an item does not exist. You can use any PowerShell-supported path:
-
env:ENV_NAME
for environment variables -
hklm:\path\to\key
for registry keys -
path\to\file
for files/directories
Relative paths are file system paths and are resolved from the directory of the build root or the task's working directory
Build:
- Log:
UnlessExists: "env:DISABLE_LOGGING"
Message: Don't show this message if the DISABLE_LOGGING environment variable exists.
Shows a task's verbose messages. Set this to true
to show verbose messages or false
to not show verbose messages. Setting the value to false
only makes sense if the global VerbosePreference
is Continue
but you want to omit a specific task's verbose messages from your output.
Build:
- Log:
Verbose: true
Level: Verbose
Message: Makes sure this message gets shown.
Shows or hides a task's warning messages. Valid values are:
-
Stop
: stop and fail a build if a task outputs a warning message. -
Ignore
: don't write any warning messages -
SilentlyContinue
: write but don't show warning messages -
Continue
: show a task's warning messages
Build:
- Log:
Level: Warning
WarningAction: Ignore
Message: This message will never get written. Sad.
The directory in which the task should run. By default, this is the directory of the whiskey.yml file being used to run the build. Should be a path relative to the whiskey.yml file used. The directory must exist.
Build:
- Log:
WorkingDirectory: some_dir
Message: $(WorkingDirectory.FullName)
- Common Task Properties
- AppVeyorWaitForBuildJob
- CopyFile
- Delete
- DotNet
- Exec
- File
- GetPowerShellModule
- GitHubRelease
- InstallNodeJs
- LoadTask
- Log
- MergeFile
- MSBuild
- NuGetPack
- NuGetPush
- NuGetRestore
- NUnit2
- NUnit3
- Parallel
- Pester
- Pipeline
- PowerShell
- ProGetUniversalPackage
- PublishBitbucketServerTag
- PublishBuildMasterPackage
- PublishNodeModule
- PublishPowerShellModule
- PublishProGetAsset
- PublishProGetUniversalPackage
- SetVariable
- SetVariableFromPowerShellDataFile
- SetVariableFromXml
- TaskDefaults
- Version
- Zip