asp.net 5 continuous integration with travis ci
TRANSCRIPT
ASP.NET 5 continuous integration with Travis CIANURAJ P (@anuraj)http://dotnetthoughts.net
Agenda• What is continuous integration?• Tools required• GitHub• Travis CI
• Demo• Questions?
What is continuous integration?Continuous Integration (CI) is a development practice that requires developers to integrate code into a shared repository several times a day. Each check-in is then verified by an automated build, allowing teams to detect problems early.
What is continuous integration?• Developer commits to GitHub
(Source control)• CI server monitors version
control using Web Hooks, triggers the build process.
• Once build and unit test / integration tests are passed, make the build successful.
• Otherwise fail the build.• Send notifications if enabled.
Image © http://www.mera.com/services/processes/integration
Tools required - GitHubGitHub is a web-based Git repository hosting service, which offers all of the distributed revision control and source code management (SCM) functionality of Git as well as adding its own features. Unlike Git, which is strictly a command-line tool, GitHub provides a web-based graphical interface and desktop as well as mobile integration. It also provides access control and several collaboration features such as wikis, task management, and bug tracking and feature requests for every project. http://www.github.com
Tools required – Travis CITravis CI is an open-source hosted, distributed continuous integration service used to build and test projects hosted at GitHub. Travis CI is configured by adding a file named .travis.yml, which is a YAML format text file, to the root directory of the GitHub repository.
https://travis-ci.org/
Configuring Travis CI• Sign in to Travis CI with your GitHub account, accepting the GitHub access permissions confirmation.• From Travis CI profile page, select the project to enable CI.• Add .travis.yml file to your repository, in root directory.• Commit something to github, which will trigger the build.
.travis.yml for ASP.NET 5 / C# projectlanguage: CSharpmono: - latestinstall: - curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | DNX_BRANCH=dev sh && source ~/.dnx/dnvm/dnvm.sh - dnvm upgrade - dnu restorescript: - dnx /home/travis/build/anuraj/ASPNET5CIDemo/test/project.json test -parallel none
.travis.yml for ASP.NET 5 – Explained •Use latest version of Mono – Travis CI is Linux container, so for C#, mono support is required.•Download and install DNVM - The .NET SDK Manager, a set of command line utilities to update and configure which runtime (DNX) to use.• Restore the nuget packages. (dnu restore)• Execute the unit tests – dnx . Test
Demohttps://github.com/anuraj/ASPNET5CIDemo
CI Bonus - Build Status flagBuild status will flag will display the build status in repository page.
https://travis-ci.org/anuraj/ASPNET5CIDemo.svg?branch=master