cloudfoundry/cf-msbuild-tasks

Name: cf-msbuild-tasks

Owner: Cloud Foundry

Description: Contains msbuild tasks for Cloud Foundry

Created: 2015-03-16 13:27:12.0

Updated: 2017-05-05 04:58:03.0

Pushed: 2017-01-12 17:45:20.0

Homepage: null

Size: 20225

Language: C#

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Summary

The cf-dotnet-sdk-msbuild-tasks project implements custom tasks that use the cf-dotnet-sdk (https://github.com/hpcloud/cf-dotnet-sdk) to facilitate .NET projects integration with CloudFoundry.

Tasks implemented in this library:

Prerequisites

Usage

In order to use this library it is necessary to map the task that is referenced to the assembly that contains the task implementation (in this case the cf-dotnet-sdk-msbuild-tasks library). This can be done by adding the UsingTask Element in your msbuild project file (https://msdn.microsoft.com/en-us/library/t41tzex2.aspx)

Logs can be found in the applications data directory of the user (%APPDATA%\Roaming\CloudFoundry\ *.log).

Project dependencies

This library uses Cloud Foundry .NET SDK and YamlDotNet libraries.

Building the project

The solution can be build simply by running msbuild CloudFoundry.Build.sln. The build output will be located in the lib folder and the tests are located in lib\tests.

Running tests

Since the unit tests are using fakes the cf-dotnet-sdk-msbuild-tasks project tests can be run only using vstest.console.exe since mstest does not support the fakes framework yet.

To run the unit tests: vstest.console.exe lib\tests\CloudFoundry.Build.Tasks.Test.dll

To run the integration tests it is necessary to modify the CloudFoundry.Build.Tasks.IntegrationTests.dll.config file and add the credentials and url of the CloudFoundry deployment used for the tests.

To run the integration tests: vstest.console.exe lib\tests\CloudFoundry.Build.Tasks.IntegrationTests.dll

Integration with a project

It is not necessary for the project that will use this library to include a reference to this library. As stated in the usage section this library should be used with a UsingTask Element straight in the project file.

Sample integration of the create application task in a target of the project file:

`

<UsingTask AssemblyFile="$(SolutionDir)\packages\Cloudfoundry.Build.Tasks.dll" TaskName="CreateApp">
</UsingTask>
        <CreateApp CFAppName="sampleApp" CFStack="win2012r2" CFSpace="SampleSpace" CFUser="sampleUser" CFPassword="samplePass" CFServerUri="api.1.2.3.4.xip.io">
            <Output TaskParameter="CFAppGuid" PropertyName="CFAppGuid"/>
        </CreateApp>
</Target>

`

This target can be called using: msbuild myproject.csproj /t:sampleCreate


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.