A Beginner’s Guide to Deployment with Continuous Integration
More Configuration Features
We’ve covered only the basic features of the Travis CI configuration. There are further options of configuring the build, which are listed below.
You can set the
quietoption ofgittotruein order to ignore cloning logs to keep your log file concise:Code snippet
git: quiet: trueSafelist and blocklist specific branches for builds using the
onlyandexceptoptions:Code snippet
# blocklist branches: except: - test_branch # safelist branches: only: - masterYou can run any custom commands before installing dependencies using the
before_installoption:Code snippet
before_install: - sudo apt-get update
Here’s the full list of customization features as listed on the Travis CI documentation.
Advanced Features of Travis CI
Now that you’ve run a basic process on Travis CI, let’s discuss a few advanced features of Travis CI. In this section, we’ll cover the integration of Travis CI with Docker, how to set up cron jobs in Travis, and advanced security features in Travis through Travis CI.
Integration with Docker
Docker is a popular software delivery service that helps you create standardized development environments. Travis integrates with Docker to set up containers in the build process.
First, you need to enable the service on Travis through the .yml configuration file. You can then pull a Docker image before running your tests. This can be done by running a docker command under the before_install section of the configuration file.