Skip to content
Mock rpmbuilder for Travis-CI.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Build Status

Mock-Travis utilizes Travis CI to provide a continuous integration practice for testing spec files of RedHat RPM packages. That is to say, Mock-Travis can be utilized to build source rpm packages and binary rpm packages in order to check whether spec files are written correctly.

Note: RPM package spec files need to be stored in the GitHub repository.

### How to use Mock-Travis? Setting up Mock-Travis is quite simple. All you need to do are just two things: - Put **`.travis.yml`** your GitHub repository. - Enable autobuild on [Travis CI]( website.

Assumption: You should know how to add file and push to your GitHub repository; how to sign in to Travis CI with your GitHub account, and go to profile page and enable Travis CI for the repository you want to build.

**Example of `.travis.yml` file** ```yml #! ------------------------------------------------------------------------- #! Mock-Travis Settings #! -------------------------------------------------------------------------


Set a particular test configuration for mock.

mock_config: fedora-24-x86_64

Use RPM spec files from a GitHub repository

to generate extra part of buildrequires packages.

For example

If your spec repository is


git could be set to nrechn/Sway-Fedora


Use extra/external repository during building packages.

This option allows mock to access an additional repository

plus defaults repositories based on the mock config.

gpgcheck is disabled in this option.

For example

If add FZUG as an extra repository

packages_extra_repo should set to



#! ------------------------------------------------------------------------- #! DO NOT EDIT THE FOLLOWING SETTINGS #! UNLESS YOU KNOW WHAT YOU ARE DOING #! -------------------------------------------------------------------------

sudo: required


  • docker


You can simply copy and paste the example above, or download the [example.travis.yml](

> **Note**: Please remember to rename **[example.travis.yml](** to **.travis.yml** if you download **[example.travis.yml](**.

### How Mock-Travis works?
When you make a push to your GitHub repository, it will trigger a [Travis CI]( build. The build process will run a docker container and do the following things:
- Initialize mock config.
- Build source packages.
- Build binary packages, and record packages build failed.
- Create local repository and add it to the mock config.
- Rebuild binary packages based on the failed records.

### Advantages
- No need to test mock build on your own computer. It is quite hard to run mock if you use other GNU/Linux distros than RedHat related GNU/Linux distros.
- No need to worry about build requires. Mock-travis gives build faild packages another try with local repository which contains packages just built. It should be sufficient to solve the missing buildrequires issue.
- Beautiful output. Mock-travis generates colorful bold information to exhibit the build process and status. The [Travis CI]( will show the whole build log. The results of each step can be found easily in build log as they will be shown in colored bold words.

Here is an example of build log:
![Travis-CI log](

> Click the picture to view the raw file.

### Projects use Mock-Travis
[nrechn/Sway-Fedora]( is a real world example of utilizing Mock-Travis. You can check its [.travis.yml]( file, or [Travis CI build log](

### Limitations
- The customizability is still low. Only provide a few options currently.
- Run `mock` in docker container to test packages is few minutes slower than test locally.

### ToDo
- Basically, it is to make mock-travis more customizable and run faster.

### Contributing
- If you have any suggestion, idea, or bug report; feel free to open an issue on this repository.
You can’t perform that action at this time.