In this video, learn about Travis CI, a popular tool among developers. This video will also highlight its tight integration with GitHub.
- [Instructor] Travis CI is a popular choice for testing open-source projects hosted on GitHub. Beyond the features that it offers for testing, it can also be used as a complete CI/CD platform. For many years, Travis CI has been the go-to choice for open source projects when they needed to include continuous integration. This is largely due to open-source projects benefiting from free hosting on GitHub. In fact, Travis only works with projects hosted on GitHub. A common use for Travis is to test pull requests submitted to a project,, If the submission passes the configured tests, then the pull request is allowed to be opened for consideration. Tests could include linting, quick unit tests, or checks for naming conventions. Each account on Travis CI starts with 100 free builds and continues to be free for open-source projects. After builds are exhausted, a request to Travis CI can add more builds to a project. Travis CI builds are configured in a hidden file named .travis.yml stored in the project's root directory. Along with running with build steps, Travis also allows you to start services and connect to them. If testing your application requires a MySQL database, for example, you can start in MySQL container, along with your build commands. This is a powerful feature that allows for integration testing, and more. And to extend Travis's capabilities even further, there are dozens of applications, clients, tools, and programming libraries that allow you to interact and monitor builds, share build notifications and much more. Before we get too caught up in all the things that Travis can do, let's take a look at how we would use it to implement our experimental pipeline. Let's start by reviewing the Travis configuration file. At the top of the file, we specify the language that we're using. Our application is written in Python, so we'll use that, as well as configure the version of Python on the next line down. We can specify additional versions to create a test matrix, which would run our test on each version, but for now, let's just pick one version of Python. In the install step, we load our project requirements, using the pip command, and beneath that is the script, with each action needed to complete our pipeline. We could use additional configurations to name each stage, to create a more exact representation of the pipeline. But just using the script is an example of how you can get started quickly with Travis and build from there. Let's trigger a build now, to see how Travis will run our build steps. On the Travis dashboard, I have the repository I want to work with, starred, so it's readily available right at the top. If you have a lot of repo's running in Travis, starring the ones you're actively working on will save time when you're looking for them. I can trigger a build on my demo repo by clicking the hamburger icon next to the repo, and selecting Trigger build. Once the build starts, I can click into the branch to see the build's progress. On this screen, Travis logs the output for each build step, so we can follow it in real time. However, if you want to keep up, you'll end up having the scroll the screen down, to get the new output. Now, let's wait for the build to finish. Once the build is finished, we can see the status of the build at the top of the page, and on the Build History page. And if we go back to the repository home page, we can see the build status here, as well. Travis allows you to share build status by embedding a badge in the README file, or any other Web page. This is a great way to share status with people that might be interested in the status of your builds, but don't have access to the Travis application.
- Key considerations in picking your stack
- The landscape of CI/CD tools
- Self-hosted options such as Jenkins and Bamboo
- SaaS tools such as Travis CI
- Using AWS CodePipeline and CodeBuild
- Tools for code repositories