[travis] Write separate scripts for before_install and after_success