Skip to content

Instantly share code, notes, and snippets.

@coder36
Created September 17, 2014 14:03
Show Gist options
  • Save coder36/f355cc9d5d3ebfedaceb to your computer and use it in GitHub Desktop.
Save coder36/f355cc9d5d3ebfedaceb to your computer and use it in GitHub Desktop.
Fake RPM's

To create fake RPM's, use fpm...

If the RPM's were created correctly in the firstplace, then the epock should be set to 0. In the scenario below, the epochs had been set to the current unin time. Strangely, you can not just set it to 9999999999? You may need to employ different strategies to get the fake package to 'win' the version battle over existing rpm's:

    mkdir -p /tmp/fake_package
    fpm -s dir -t rpm -n grpahite -v 999999999 --epoch `date +%s` -f -a noarch -C /tmp/fake_package ./
    fpm -s dir -t rpm -n logstash -v 0.0.1 --epoch `date +%s` --iteration 999 -f -C /tmp/fake_package ./
    fpm -s dir -t rpm -n sensu -v 0.0.1 --epoch `date +%s` --iteration 999 -f -C /tmp/fake_package ./
    fpm -s dir -t rpm -n uchiwa -v 0.0.1 --epoch `date +%s` --iteration 999 -f -C /tmp/fake_package ./

Why fake rpm's?

We had a dependency on an RPM which took 30 mins to complete. When we were TDD'ing our ansible scripts, we needed as short a feedback loop as possible, so took the decision to 'mock' out some of our dependencies. Fake rpm's was the simplest solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment