DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Code in GitHub, Build in Azure DevOps for Free

Code in GitHub, Build in Azure DevOps for Free

Learn how to use Azure DevOps's free build pipelines to build projects in GitHub.

Ricci Gian Maria user avatar by
Ricci Gian Maria
·
Oct. 20, 18 · Tutorial
Like (7)
Save
Tweet
Share
11.00K Views

Join the DZone community and get the full member experience.

Join For Free

when you create a new open-source project in github, one of the first steps is to set up continuous integration; the usual question is, what ci engine should i use? thanks to azure devops, you can use free build pipelines to build projects even if they are in github (not hosted in azure devops).

azure devops, formerly known as vsts, allows you to define free build pipelines to build projects in github. after you've created a new project in github, you can simply log into your azure devops account , then go to azure pipelines and start creating a new pipeline.

wizard to create a new pipeline in azure devops.

as you can see, you can choose github repository or azure repositories. this is the latest ui available for azure pipelines and allows you to create a pipeline with yaml (definition with code). since i really prefer this approach than the usual graphical editor, i choose to create my new pipeline with yaml, so i simply press git hub to specify that i want to build a project hosted in github.

pressing "authorize," you can authorize with oauth in github. if you prefer, you can use a token or install the azure devops app from the github marketplace, but for this example, i'm using oauth, because it is the simpler approach.

image title

once logged in, i can browse and search for the repository i want to build.

image title

when you choose the repository, the wizard analyzes the code in the repository, suggesting the template that best suits your need. in my example, the code is a standard .net desktop application (a console app).

image title

you can choose another template or you can start from an empty template. whatever is your choice, you can always change the template later, so i chose .net desktop and moved on.

thanks to the new wizard, you can start with a template and a yaml definition that contains basic steps to use as a starting point.

once i've chosen the template, the wizard generates a yaml build definition based on that template, as shown here:

image title

clearly, the yaml code for the build should be in the repository, so i press the save and run button, then choose to create the file in another special branch.

image title

once the wizard commits the yaml definition, the build immediately starts, so you can verify if everything is ok. the nice aspect is that you do not need to configure a build agent because the build will be executed by hosted agent, an agent automatically managed by microsoft, which is hosted in azure. for open-source projects, azure devops gives you 10 concurrent builds with unlimited minutes per month, this is really cool. azure pipelines gives you free minutes month and 10 concurrent builds for open-source projects.

image title

the yaml definition is created on the root folder of the repository, if you do not like the position you can simply manually change location and name of the file, then update the build definition to use the new location. usually, i change the location, add the list of branches i want to monitor with continuous integration and add my gitversion task to assign build number with gitversion.

image title

just push with the new definition and now you define triggers that automatically builds every push to standard master, develop, feature, release, and hotfix branches. thanks to the yaml definition, everything regarding the build is defined in the yaml file.

once the build is up and running, you can go to the summary of the pipeline definition and you can grab the link for the badge to use in the readme in github.

image title

pressing the status badge will show you links to render build badges. usually, you can put these links into the readme.md of your repository. if you look at the badge url, you can verify that you can specify any branch name; for a gitflow-enabled repository, at least, i'm going to show the status for the master and development branches.

et voilĂ , badges can be included in the github readme.

image title

thanks to azure pipelines i've setup with few minutes of work a continuous integration pipeline; absolutely for free, without the need to install any agent and directly with yaml code.

Continuous Integration/Deployment azure GitHub DevOps Open source Pipeline (software) Repository (version control)

Published at DZone with permission of Ricci Gian Maria, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Cloud-Based Transportation Management System
  • Best Practices for Writing Clean and Maintainable Code
  • How To Validate Three Common Document Types in Python
  • Apache Kafka vs. Memphis.dev

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: