asp.net 5 continuous integration with travis ci

11
ASP.NET 5 continuous integration with Travis CI ANURAJ P (@anuraj ) http://dotnetthoughts.net

Upload: anuraj-p

Post on 21-Feb-2017

205 views

Category:

Software


0 download

TRANSCRIPT

Page 1: ASP.NET 5 Continuous Integration with Travis CI

ASP.NET 5 continuous integration with Travis CIANURAJ P (@anuraj)http://dotnetthoughts.net

Page 2: ASP.NET 5 Continuous Integration with Travis CI

Agenda• What is continuous integration?• Tools required• GitHub• Travis CI

• Demo• Questions?

Page 3: ASP.NET 5 Continuous Integration with Travis CI

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.

Page 4: ASP.NET 5 Continuous Integration with Travis CI

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

Page 5: ASP.NET 5 Continuous Integration with Travis CI

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

Page 6: ASP.NET 5 Continuous Integration with Travis CI

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/

Page 7: ASP.NET 5 Continuous Integration with Travis CI

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.

Page 8: ASP.NET 5 Continuous Integration with Travis CI

.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

Page 9: ASP.NET 5 Continuous Integration with Travis CI

.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

Page 10: ASP.NET 5 Continuous Integration with Travis CI

Demohttps://github.com/anuraj/ASPNET5CIDemo

Page 11: ASP.NET 5 Continuous Integration with Travis CI

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