-
Notifications
You must be signed in to change notification settings - Fork 0
YAMLConfig
Many of the rake tasks in Albacore support the ability to configure attributes via an external YAML file. This is useful in scenarios where different environments need to have different configuration settings, while still maintaining the core rake file in version control.
For example, if developers are working on their own local copy of a database, they may want to configure the SQLCmd task with their own local database connection information. However, they will not want their local connection information stored in the master rakefile because that would break the build automation server and/or other developers that pull down the file from source control. To facilitate this situation, call the .configure method on an Albacore task that supports it, and load your configuration from an external yaml file.
Albacore will automatically search for a lowercase .yml file named after the task being run, and use the data in that file to configure your task. If the file is not found, it will continue on normally. After the yaml file has been loaded (or skipped), your regular task definition code will be called. You can override anything that the yaml file set during the standard task definition code.
Almost all Albacore tasks support the YAML auto-configuration. To make use of this feature, you need to name the yaml file based on the name of the task. For example, if you create a task as mbsuild :compile do ... end then you would name the yaml file compile.yml
In addition to the auto-configuration, YAMLConfig also supports a manual configuration option, which allows you to specify any valid .yml file in any location.
The SQLCmdTask supports configuration via YAML files. To do this, call the .configure method and provide the location of the yml file.
desc "Create the initial R1 database"
sqlcmd :create_initial_db do |sql|
sql.configure("sqlcmd.yml")
sql.variables :New_DB_Name => "Albacore_Test"
sql.command_directory = "SQLScripts\\Database\\Db_R1_scripts\\CreateDB"
sql.scripts "RunCreateDatabase.sql"
end
The contents of the yml file should be name: value pairs that represent the sqlcmd settings and values for those settings. For example, in the above example, the server, database, username and password can all be specified through this yml file:
sqlcmd.yml
command: sqlcmd.exe
server: some_server_name
database: some_database
username: some_user
password: shh!!! it's a secret!
- Build-Server Integration
- Command Line Task Options
- Configuration
- Custom Tasks
- Logging Options
- Sample Usages
- Task Arguments and Rakefile Parameters
- YAML Configuration
- ASP.NET Compiler - ASP.Net website compiler
- Assembly Info Generator - generate assembly info dynamically
- CSC - C# compiler
- Exec - Execute arbitrary cmd
- Fluent Migrator - Run FluentMigrator on migration library
- ILMerge - Merge dll/exe-s together
- MSBuild and XBuild - Compile a .sln-file or a MsBuild xml-file
- MSpec - Test using MSpec (machine.specifications)
- MSTest - Test using Microsoft Test Framework
- NAnt - Run a NAnt script
- NChurn - Calculate per-file churn
- NCover Console - Run NCover for tests/library
- NCover Reports - Generate a report from a coverage run
- NDepend - Run NDepend to check static code metrics
- NuGet Install - Install NuGet packages
- NuGet Pack - Create NuGet packages
- NuGet Push - Push NuGet packages to official MS repo
- NuGet Publish - Publish NuGet packages
- NUnit - Test using NUnit
- NuSpec - Generate a NuSpec file
- Output - File copying and template expansion
- PLink - SSH into a remote computer and run a command
- SQLCmd - Run a SQL command as a part of your build process
- UnZip - Unzip a directory
- XBuild - Run XBuild (will be merged into MsBuild)
- XUnit - Test using XUnit
- Zip - Zip a directory or files
- Edit the Wiki Locally - How to edit the wiki without using Github's interface
- How to Build Albacore
- How to Contribute