travis: Split build logic into a separate script